From b2dba1af3c4157040303a76d25216b1713d333d0 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 23 Nov 2011 19:26:23 -0500 Subject: 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 --- fs/mount.h | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 fs/mount.h (limited to 'fs/mount.h') diff --git a/fs/mount.h b/fs/mount.h new file mode 100644 index 000000000000..7890e49f74ef --- /dev/null +++ b/fs/mount.h @@ -0,0 +1,6 @@ +#include + +static inline int mnt_has_parent(struct vfsmount *mnt) +{ + return mnt != mnt->mnt_parent; +} -- cgit v1.2.3-59-g8ed1b