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);