From patchwork Wed Sep 14 06:14:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Kent X-Patchwork-Id: 9330437 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 53615607FD for ; Wed, 14 Sep 2016 06:15:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 42CC529941 for ; Wed, 14 Sep 2016 06:15:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3797F29947; Wed, 14 Sep 2016 06:15:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC1C529941 for ; Wed, 14 Sep 2016 06:15:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755960AbcINGOk (ORCPT ); Wed, 14 Sep 2016 02:14:40 -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 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 46C78203A6; Wed, 14 Sep 2016 02:14:38 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute7.internal (MEProxy); Wed, 14 Sep 2016 02:14:38 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=themaw.net; h=cc :content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=rJE AvzKqdy9pMl4MmXsjzo+2vd8=; b=N/AKvk/7Q/EXoPDyThXRK7DvFFOC7QpGUyu M37HfeM/YrKnxXZwRHeqyt4UAp9MRfURKfeQALmGdZRmIUAdTL8Cc1SM5NkEGJGx fo12R7+41dn+bAbt3vtBvWeCJvKQqx8keSVvNNAAS+PCpsgfQtTIU7xPFJ56gdbg XB3KqpVE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=rJEAvzKqdy9pMl4MmXsjzo+2vd8=; b=dok6T uJLXBFRAUPd5/rmZH/9GXZ14CkWCnqoPC0Md6zd36YjzozI0Py1PRMn8T7QFx5Lq sEpxAKF3R4a2uAhn4u1YDhhzgwdfwUV5wyOt0ij8Nw5ak20B+aHRM9W4d+UgJoSw wc8eXoDmWqN20L4oX6E5Hoy/M69sDClVHgCHho= X-Sasl-enc: 7nZi458qtic8MqUjz4eCnVjbbxfUbT1HdmC1rkYrq9q8 1473833677 Received: from pluto.themaw.net (106-68-162-102.dyn.iinet.net.au [106.68.162.102]) by mail.messagingengine.com (Postfix) with ESMTPA id AA4E3F29D9; Wed, 14 Sep 2016 02:14:37 -0400 (EDT) Received: from pluto.themaw.net (localhost [127.0.0.1]) by pluto.themaw.net (Postfix) with ESMTP id D1567A0061; Wed, 14 Sep 2016 14:14:34 +0800 (AWST) 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 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 */