]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/shared/mount-util.h
mount-util: introduce remount_sysfs()
[thirdparty/systemd.git] / src / shared / mount-util.h
index f6de42e1a027bab4322c20232e8c25545a340308..84ea4b6392773f388e132b7f0c5f877ccd1c9043 100644 (file)
 #include "errno-util.h"
 #include "macro.h"
 
-typedef enum MountAttrPropagationType {
-        MOUNT_ATTR_PROPAGATION_INHERIT,   /* no special MS_* propagation flags */
-        MOUNT_ATTR_PROPAGATION_PRIVATE,   /* MS_PRIVATE */
-        MOUNT_ATTR_PROPAGATION_DEPENDENT, /* MS_SLAVE */
-        MOUNT_ATTR_PROPAGATION_SHARED,    /* MS_SHARE */
-
-        _MOUNT_ATTR_PROPAGATION_TYPE_MAX,
-        _MOUNT_ATTR_PROPAGATION_TYPE_INVALID = -EINVAL,
-} MountAttrPropagationType;
-
-const char* mount_attr_propagation_type_to_string(MountAttrPropagationType t) _const_;
-MountAttrPropagationType mount_attr_propagation_type_from_string(const char *s) _pure_;
-unsigned int mount_attr_propagation_type_to_flag(MountAttrPropagationType t);
-
 int repeat_unmount(const char *path, int flags);
 int umount_recursive(const char *target, int flags);
 
@@ -35,7 +21,7 @@ static inline int bind_remount_recursive(const char *prefix, unsigned long new_f
 
 int bind_remount_one_with_mountinfo(const char *path, unsigned long new_flags, unsigned long flags_mask, FILE *proc_self_mountinfo);
 
-int mount_switch_root(const char *path, MountAttrPropagationType type);
+int mount_switch_root(const char *path, unsigned long mount_propagation_flag);
 
 DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(FILE*, endmntent, NULL);
 #define _cleanup_endmntent_ _cleanup_(endmntentp)
@@ -119,6 +105,14 @@ typedef enum RemountIdmapping {
 
 int remount_idmap(const char *p, uid_t uid_shift, uid_t uid_range, uid_t owner, RemountIdmapping idmapping);
 
+int remount_and_move_sub_mounts(
+                const char *what,
+                const char *where,
+                const char *type,
+                unsigned long flags,
+                const char *options);
+int remount_sysfs(const char *where);
+
 /* Creates a mount point (not parents) based on the source path or stat - ie, a file or a directory */
 int make_mount_point_inode_from_stat(const struct stat *st, const char *dest, mode_t mode);
 int make_mount_point_inode_from_path(const char *source, const char *dest, mode_t mode);