From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757902AbcINGOn (ORCPT ); Wed, 14 Sep 2016 02:14:43 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:36628 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751119AbcINGOj (ORCPT ); Wed, 14 Sep 2016 02:14:39 -0400 X-Sasl-enc: 7nZi458qtic8MqUjz4eCnVjbbxfUbT1HdmC1rkYrq9q8 1473833677 Subject: [PATCH 1/4] fs - make is_local_mountpoint() usable by others From: Ian Kent To: Andrew Morton Cc: autofs mailing list , Kernel Mailing List , Al Viro , linux-fsdevel , Omar Sandoval , "Eric W. Biederman" Date: Wed, 14 Sep 2016 14:14:34 +0800 Message-ID: <20160914061434.24714.490.stgit@pluto.themaw.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The is_local_mountpoint() function will be needed for autofs to check if a dentry is a mountpoint in the current namespace. Signed-off-by: Ian Kent Cc: Al Viro Cc: Eric W. Biederman Cc: Omar Sandoval --- fs/mount.h | 9 --------- fs/namespace.c | 1 + include/linux/mount.h | 9 +++++++++ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/fs/mount.h b/fs/mount.h index 14db05d..c25e6e8 100644 --- a/fs/mount.h +++ b/fs/mount.h @@ -127,12 +127,3 @@ struct proc_mounts { }; extern const struct seq_operations mounts_op; - -extern bool __is_local_mountpoint(struct dentry *dentry); -static inline bool is_local_mountpoint(struct dentry *dentry) -{ - if (!d_mountpoint(dentry)) - return false; - - return __is_local_mountpoint(dentry); -} diff --git a/fs/namespace.c b/fs/namespace.c index 7bb2cda..bea1507 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -725,6 +725,7 @@ bool __is_local_mountpoint(struct dentry *dentry) out: return is_covered; } +EXPORT_SYMBOL(__is_local_mountpoint); static struct mountpoint *lookup_mountpoint(struct dentry *dentry) { diff --git a/include/linux/mount.h b/include/linux/mount.h index 54a594d..575b745 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h @@ -15,6 +15,7 @@ #include #include #include +#include struct super_block; struct vfsmount; @@ -96,4 +97,12 @@ extern void mark_mounts_for_expiry(struct list_head *mounts); extern dev_t name_to_dev_t(const char *name); +extern bool __is_local_mountpoint(struct dentry *dentry); +static inline bool is_local_mountpoint(struct dentry *dentry) +{ + if (!d_mountpoint(dentry)) + return false; + + return __is_local_mountpoint(dentry); +} #endif /* _LINUX_MOUNT_H */