2020-11-09 05:23:58 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
2012-07-18 19:07:51 +02:00
|
|
|
#pragma once
|
2010-08-11 22:58:34 +02:00
|
|
|
|
2014-12-27 18:46:36 +01:00
|
|
|
#include <stdbool.h>
|
|
|
|
#include <sys/types.h>
|
2010-08-11 22:58:34 +02:00
|
|
|
|
2018-03-27 07:38:26 +02:00
|
|
|
typedef enum LabelFixFlags {
|
2018-06-07 16:03:43 +02:00
|
|
|
LABEL_IGNORE_ENOENT = 1 << 0,
|
|
|
|
LABEL_IGNORE_EROFS = 1 << 1,
|
2018-03-27 07:38:26 +02:00
|
|
|
} LabelFixFlags;
|
|
|
|
|
2020-02-18 12:18:39 +01:00
|
|
|
int label_fix_container(const char *path, const char *inside_path, LabelFixFlags flags);
|
|
|
|
static inline int label_fix(const char *path, LabelFixFlags flags) {
|
|
|
|
return label_fix_container(path, path, flags);
|
|
|
|
}
|
2014-10-23 19:58:45 +02:00
|
|
|
|
|
|
|
int mkdir_label(const char *path, mode_t mode);
|
2018-04-27 12:55:56 +02:00
|
|
|
int mkdirat_label(int dirfd, const char *path, mode_t mode);
|
2014-10-23 19:58:45 +02:00
|
|
|
int symlink_label(const char *old_path, const char *new_path);
|
2020-09-01 15:48:53 +02:00
|
|
|
int symlink_atomic_label(const char *from, const char *to);
|
2020-07-10 21:37:44 +02:00
|
|
|
int mknod_label(const char *pathname, mode_t mode, dev_t dev);
|
2017-12-19 14:33:11 +01:00
|
|
|
|
|
|
|
int btrfs_subvol_make_label(const char *path);
|