* [to-be-updated] fs-add-have_local_submounts.patch removed from -mm tree
@ 2016-09-30 18:38 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2016-09-30 18:38 UTC (permalink / raw)
To: raven, ebiederm, osandov, viro, mm-commits
The patch titled
Subject: vfs: add have_local_submounts()
has been removed from the -mm tree. Its filename was
fs-add-have_local_submounts.patch
This patch was dropped because an updated version will be merged
------------------------------------------------------
From: Ian Kent <raven@themaw.net>
Subject: vfs: add have_local_submounts()
have_submounts() checks if a dentry is a mountpoint in any namespace but
autofs needs to know if the dentry is a mountpoint within the current
namespace.
Add have_local_submounts() to to do this.
Link: http://lkml.kernel.org/r/20160914061440.24714.82139.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>
---
fs/dcache.c | 34 ++++++++++++++++++++++++++++++++++
include/linux/dcache.h | 1 +
2 files changed, 35 insertions(+)
diff -puN fs/dcache.c~fs-add-have_local_submounts fs/dcache.c
--- a/fs/dcache.c~fs-add-have_local_submounts
+++ a/fs/dcache.c
@@ -1307,6 +1307,40 @@ int have_submounts(struct dentry *parent
EXPORT_SYMBOL(have_submounts);
/*
+ * Search for at least 1 mount point in the dentry's subdirs.
+ * We descend to the next level whenever the d_subdirs
+ * list is non-empty and continue searching.
+ */
+
+static enum d_walk_ret check_local_mount(void *data, struct dentry *dentry)
+{
+ int *ret = data;
+ if (is_local_mountpoint(dentry)) {
+ *ret = 1;
+ return D_WALK_QUIT;
+ }
+ return D_WALK_CONTINUE;
+}
+
+/**
+ * have_local_submounts - check for mounts over a dentry
+ * in the current namespace
+ * @parent: dentry to check.
+ *
+ * Return true if the parent or its subdirectories contain
+ * a mount point
+ */
+int have_local_submounts(struct dentry *parent)
+{
+ int ret = 0;
+
+ d_walk(parent, &ret, check_local_mount, NULL);
+
+ return ret;
+}
+EXPORT_SYMBOL(have_local_submounts);
+
+/*
* Called by mount code to set a mountpoint and check if the mountpoint is
* reachable (e.g. NFS can unhash a directory dentry and then the complete
* subtree can become unreachable).
diff -puN include/linux/dcache.h~fs-add-have_local_submounts include/linux/dcache.h
--- a/include/linux/dcache.h~fs-add-have_local_submounts
+++ a/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 have_local_submounts(struct dentry *);
/*
* This adds the entry to the hash queues.
_
Patches currently in -mm which might be from raven@themaw.net are
autofs-fix-autofs4_fill_super-error-exit-handling.patch
autofs-remove-ino-free-in-autofs4_dir_symlink.patch
autofs-fix-dev-ioctl-number-range-check.patch
autofs-add-autofs_dev_ioctl_version-for-autofs_dev_ioctl_version_cmd.patch
autofs4-move-linux-auto_dev-ioctlh-to-uapi-linux.patch
autofs-make-mountpoint-checks-namespace-aware.patch
fs-remove-unused-have_submounts-function.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-09-30 18:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-30 18:38 [to-be-updated] fs-add-have_local_submounts.patch removed from -mm tree akpm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).