Commit 3ea73d7f authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

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: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent b2504e07
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment