2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

mount: move is_root, is_root, fsroot_mounted to the top of the file

They are trivial and these functions will be used in many places

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrey Vagin
2013-07-30 20:25:30 +04:00
committed by Pavel Emelyanov
parent b2504e0763
commit 3ea73d7f9b

30
mount.c
View File

@@ -27,6 +27,21 @@
static struct mount_info *mntinfo;
int mntns_root = -1;
static inline int is_root(char *p)
{
return p[0] == '/' && p[1] == '\0';
}
static inline int is_root_mount(struct mount_info *mi)
{
return is_root(mi->mountpoint);
}
static inline int fsroot_mounted(struct mount_info *mi)
{
return is_root(mi->root);
}
int open_mount(unsigned int s_dev)
{
struct mount_info *i;
@@ -442,16 +457,6 @@ static struct fstype *decode_fstype(u32 fst)
return &fstypes[fst];
}
static inline int is_root(char *p)
{
return p[0] == '/' && p[1] == '\0';
}
static inline int is_root_mount(struct mount_info *mi)
{
return is_root(mi->mountpoint);
}
static int validate_shared(struct mount_info *info)
{
struct mount_info *m, *t;
@@ -633,11 +638,6 @@ static int do_bind_mount(struct mount_info *mi)
return -1;
}
static inline int fsroot_mounted(struct mount_info *mi)
{
return is_root(mi->root);
}
static int do_mount_one(struct mount_info *mi)
{
if (!mi->parent)