From 08b893fd03e021fc2e19fa4de1582d1643209cb7 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Thu, 26 Dec 2013 11:22:01 +0400 Subject: [PATCH] mount: Add comment to is_root_xxx checks Signed-off-by: Pavel Emelyanov --- mount.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mount.c b/mount.c index ffcef4511..be68da986 100644 --- a/mount.c +++ b/mount.c @@ -50,11 +50,20 @@ static inline int is_root(char *p) return p[0] == '/' && p[1] == '\0'; } +/* True for the root mount (the topmost one) */ static inline int is_root_mount(struct mount_info *mi) { return is_root(mi->mountpoint); } +/* + * True if the mountpoint target is root on its FS. + * + * This is used to determine whether we need to postpone + * mounting. E.g. one can bind mount some subdir from a + * disk, and in this case we'll have to get the root disk + * mount first, then bind-mount it. See do_mount_one(). + */ static inline int fsroot_mounted(struct mount_info *mi) { return is_root(mi->root);