summaryrefslogtreecommitdiff
path: root/include/linux/dcache.h
diff options
context:
space:
mode:
authorIan Kent <ikent@redhat.com>2016-11-24 00:03:41 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2016-12-04 04:51:47 +0300
commit01619491a5f0766014fe863c5ae480665436e7a2 (patch)
treee9f8f4fcf30337b805c76f8fcc83baa517779359 /include/linux/dcache.h
parentc6609c0a1c34fc097152b28b496236625673924f (diff)
downloadlinux-01619491a5f0766014fe863c5ae480665436e7a2.tar.xz
vfs: add path_has_submounts()
d_mountpoint() can only be used reliably to establish if a dentry is not mounted in any namespace. It isn't aware of the possibility there may be multiple mounts using the given dentry, possibly in a different namespace. Add function, path_has_submounts(), that checks is a struct path contains mounts (or is a mountpoint itself) to handle this case. Link: http://lkml.kernel.org/r/20161011053403.27645.55242.stgit@pluto.themaw.net Signed-off-by: Ian Kent <raven@themaw.net> Cc: Al Viro <viro@ZenIV.linux.org.uk> Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: Omar Sandoval <osandov@osandov.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/dcache.h')
-rw-r--r--include/linux/dcache.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index bc529ce88ed0..0ffaf7aef9ae 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -255,6 +255,7 @@ extern void d_prune_aliases(struct inode *);
/* test whether we have any submounts in a subdir tree */
extern int have_submounts(struct dentry *);
+extern int path_has_submounts(const struct path *);
/*
* This adds the entry to the hash queues.