[CRIU] [PATCH 05/11] mount: move is_root, is_root, fsroot_mounted to the top of the file

Andrey Vagin avagin at openvz.org
Tue Jul 30 12:25:30 EDT 2013


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

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 mount.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/mount.c b/mount.c
index 49ad16a..1391fa9 100644
--- a/mount.c
+++ b/mount.c
@@ -26,6 +26,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;
@@ -522,16 +537,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 dump_one_mountpoint(struct mount_info *pm, int fd)
 {
 	MntEntry me = MNT_ENTRY__INIT;
@@ -738,11 +743,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)
-- 
1.8.3.1



More information about the CRIU mailing list