Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4750586pxv; Tue, 27 Jul 2021 15:44:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykDe9fgJuAdndxK6W7AvKaQuRJ9+SfxHfYaa7OIvkBshw0ddic5M0tSXm+C2BAWFibbuWx X-Received: by 2002:a92:a013:: with SMTP id e19mr18106588ili.206.1627425862691; Tue, 27 Jul 2021 15:44:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627425862; cv=none; d=google.com; s=arc-20160816; b=eNGZ6mT2OKb08Vobqs6QSJHk2WXhxlQOfFLOENpXBYibf9kcmDzUZZQsOQ+MI1WzLz 0zRFYoHyndYxSGSEfpJahLK4huWvB+PZtBy/InSd4dYnyDsQedfOmXvqayXeU+7/Bmuz iyNyxEut16ahswjPLP3sBUjiK0F8VP25o+2r84cSdoJzOPA9kY9HoKZ6bR1cCyt63l7M OieFUqMi2tMtpFMikNuTowCD5+eI1FJAp21mOtxeCiXa3nHe0HzpHNjvO8UrUCUfDJDQ dUwc7RUYb61f95NQlHjnh1h3x4pXetSyLQH35FRaTUWuNTEwPM2ZfbhjgB3pM21Woei7 4O9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:dkim-signature:dkim-signature; bh=0TpbPbKdpPuBJzOYDLGprabdAvWGnrm1h37EgRsFnts=; b=vUXFVCuMCMy1w/APkvAlbzSGn0xbBbiSAkvjLhvQuIazttP9rL4bFCg2qBhlw/dgky u2X1I/0k3qw1jUOgmX9x+SVBgp2C9a0Zv7jtYGCKlvFeWS5ra90JqqSGzbYnt1d7WztT RJgPxV2J0/Nq4NJo+vkHuLmyi5hhW035WKs0MwsVZ5crixsItVEUjr8NB+IVU2Qaxs2w cczTKEP8XuBPhuM+TAs0fYXVYJZIODKlTACkg9WXn0J5SIZu1l+5Aun2NuFUsGfDdVJ4 2Rixru5kyaxH1g99YOl/mdV3D+YYAoSfO49Uu3mS0iE6HfL7R1T9qLuakpq/qG58CloI 3SBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=nL3M6YWd; dkim=neutral (no key) header.i=@suse.de header.b=CZzlkIxk; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l14si812850ilf.126.2021.07.27.15.44.11; Tue, 27 Jul 2021 15:44:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=nL3M6YWd; dkim=neutral (no key) header.i=@suse.de header.b=CZzlkIxk; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232972AbhG0WnH (ORCPT + 99 others); Tue, 27 Jul 2021 18:43:07 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:57124 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232810AbhG0WnF (ORCPT ); Tue, 27 Jul 2021 18:43:05 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 00CDC21E78; Tue, 27 Jul 2021 22:43:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1627425784; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0TpbPbKdpPuBJzOYDLGprabdAvWGnrm1h37EgRsFnts=; b=nL3M6YWdd6o/ZyD521zO3PjVfu0MTzCsWfh5OhGkhN+KcPtsm7tK6ucvRHtwju5ekFeADP 8VOhZduis4H2FoVdVUGFqcb/2iWKNHpSknpDOKR1qiyrsY60T7v7yJY90My65vOmYcvRjO XgoiDdNrdPjliyJXcZTC6eovo4jU+aE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1627425784; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0TpbPbKdpPuBJzOYDLGprabdAvWGnrm1h37EgRsFnts=; b=CZzlkIxkHsCqWkUwj+ehsgFgw7bBL5VYd774t4FPisdItlI2nO0Krq1bvu+lubYsJBh0kb 8RxuZBklBv4lCnDw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1FA2313A5D; Tue, 27 Jul 2021 22:43:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 2DnzM/SLAGGsVQAAMHmgww (envelope-from ); Tue, 27 Jul 2021 22:43:00 +0000 Subject: [PATCH 04/11] VFS: export lookup_mnt() From: NeilBrown To: Christoph Hellwig , Josef Bacik , "J. Bruce Fields" , Chuck Lever , Chris Mason , David Sterba , Alexander Viro Cc: linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-btrfs@vger.kernel.org Date: Wed, 28 Jul 2021 08:37:45 +1000 Message-ID: <162742546551.32498.5847026750506620683.stgit@noble.brown> In-Reply-To: <162742539595.32498.13687924366155737575.stgit@noble.brown> References: <162742539595.32498.13687924366155737575.stgit@noble.brown> User-Agent: StGit/0.23 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org In order to support filehandle lookup in filesystems with internal mounts (multiple subvols in the one filesystem) reconnect_path() in exportfs will need to find out if a given dentry is already mounted. This can be done with the function lookup_mnt(), so export that to make it available. Signed-off-by: NeilBrown --- fs/internal.h | 1 - fs/namespace.c | 1 + include/linux/mount.h | 2 ++ 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/internal.h b/fs/internal.h index 3ce8edbaa3ca..0feb2722d2e5 100644 --- a/fs/internal.h +++ b/fs/internal.h @@ -81,7 +81,6 @@ int do_renameat2(int olddfd, struct filename *oldname, int newdfd, /* * namespace.c */ -extern struct vfsmount *lookup_mnt(const struct path *); extern int finish_automount(struct vfsmount *, struct path *); extern int sb_prepare_remount_readonly(struct super_block *); diff --git a/fs/namespace.c b/fs/namespace.c index 81b0f2b2e701..73bbdb921e24 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -662,6 +662,7 @@ struct vfsmount *lookup_mnt(const struct path *path) rcu_read_unlock(); return m; } +EXPORT_SYMBOL(lookup_mnt); static inline void lock_ns_list(struct mnt_namespace *ns) { diff --git a/include/linux/mount.h b/include/linux/mount.h index 5d92a7e1a742..1d3daed88f83 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h @@ -118,6 +118,8 @@ extern unsigned int sysctl_mount_max; extern bool path_is_mountpoint(const struct path *path); +extern struct vfsmount *lookup_mnt(const struct path *); + extern void kern_unmount_array(struct vfsmount *mnt[], unsigned int num); #endif /* _LINUX_MOUNT_H */