summaryrefslogtreecommitdiffstats
path: root/fs/mount.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-11-23 19:26:23 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-01-03 22:52:36 -0500
commitb2dba1af3c4157040303a76d25216b1713d333d0 (patch)
treec846b1c8074d29b9fc02ef3eeda98631dfd6ee94 /fs/mount.h
parentaa9c0e07bb90589186f3b5a0ca97660c2cb50806 (diff)
downloadop-kernel-dev-b2dba1af3c4157040303a76d25216b1713d333d0.zip
op-kernel-dev-b2dba1af3c4157040303a76d25216b1713d333d0.tar.gz
vfs: new internal helper: mnt_has_parent(mnt)
vfsmounts have ->mnt_parent pointing either to a different vfsmount or to itself; it's never NULL and termination condition in loops traversing the tree towards root is mnt == mnt->mnt_parent. At least one place (see the next patch) is confused about what's going on; let's add an explicit helper checking it right way and use it in all places where we need it. Not that there had been too many, but... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/mount.h')
-rw-r--r--fs/mount.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/mount.h b/fs/mount.h
new file mode 100644
index 0000000..7890e49
--- /dev/null
+++ b/fs/mount.h
@@ -0,0 +1,6 @@
+#include <linux/mount.h>
+
+static inline int mnt_has_parent(struct vfsmount *mnt)
+{
+ return mnt != mnt->mnt_parent;
+}
OpenPOWER on IntegriCloud