Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp300467pxb; Thu, 21 Jan 2021 07:27:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJx/Q+zIoIonR03fKuMr1VEJjQtIwXsRKdot0lt1s5c6fYK9DLq7YzPg/BPiZmK1ClHD4j1R X-Received: by 2002:a50:fb04:: with SMTP id d4mr8201534edq.315.1611242819791; Thu, 21 Jan 2021 07:26:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611242819; cv=none; d=google.com; s=arc-20160816; b=CxLbSF3OpCgx2BGXbLjL7vK0z6SpySr9rAsbPtaazgzBZtxDLlVdYKCanog+SlVGOh ybTJr39d41oOlIzmAKEn9K74DDlTGyZdhMDNqoU2Pn097k4ibhKZ19eQt8ApjjtLaDgC 2pXIJ5bqYwq/7jbqYxCl0sDhhRz2qE8Rn1pK/Z/UcGoiUfjBjsg8ZlxtHcw51T1nDSuI 7UAfTiL4MWidgzSVf1lITUs16FmuQKqnoQ/HVY+UzIhXJ4N56OsSCHKDUxQ8KB/6tVqm WhTO0WsLPCaxG//jUaHPQXJmhrMr3qyl7tjEUE7VA692XupNL6G8m37mScbYrYilnqIo ldTg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ARfmn1drqz5UJbG7MNy2fCqifxCeDXb2VDvP0fCYr8I=; b=tnf+W8a0M6xSVZMvWaYLEFDvmt/NLKxK33PnLFlr/+T9k09n14bCWz+k6WrWGk+G5k EORDA7xyO+Ua0SbWEtnBhbAq1w0unxcTeaqgcG21a5eDMzmbC7l8RBq7+WdsX2i/EJK2 3SQFcLeQwuok/OrOUlG/7p7L4+Pt6gUj3zwvltOU0Zz+tlvTkUNx2bc3kFo1nPCWwwGl 1X3aWml7FkdiAnt9qKnLylBa2lmzt43tnUi1yu14FB93ZhQFIesoFAAIkBspRzcYnnfi QpHEchKtDHN/aiNPLrM3rSFuV2d4chbb0sjpamIJMGzmEYpyYYc9AtFg7wnRZCe2HWlg Vpcw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-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 u8si2360433edj.434.2021.01.21.07.26.34; Thu, 21 Jan 2021 07:26:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732439AbhAUPZ7 (ORCPT + 99 others); Thu, 21 Jan 2021 10:25:59 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:54575 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731852AbhAUNYt (ORCPT ); Thu, 21 Jan 2021 08:24:49 -0500 Received: from ip5f5af0a0.dynamic.kabel-deutschland.de ([95.90.240.160] helo=wittgenstein.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1l2Zuu-0005g7-0W; Thu, 21 Jan 2021 13:22:28 +0000 From: Christian Brauner To: Alexander Viro , Christoph Hellwig , linux-fsdevel@vger.kernel.org Cc: John Johansen , James Morris , Mimi Zohar , Dmitry Kasatkin , Stephen Smalley , Casey Schaufler , Arnd Bergmann , Andreas Dilger , OGAWA Hirofumi , Geoffrey Thomas , Mrunal Patel , Josh Triplett , Andy Lutomirski , Theodore Tso , Alban Crequy , Tycho Andersen , David Howells , James Bottomley , Seth Forshee , =?UTF-8?q?St=C3=A9phane=20Graber?= , Linus Torvalds , Aleksa Sarai , Lennart Poettering , "Eric W. Biederman" , smbarber@chromium.org, Phil Estes , Serge Hallyn , Kees Cook , Todd Kjos , Paul Moore , Jonathan Corbet , containers@lists.linux-foundation.org, linux-security-module@vger.kernel.org, linux-api@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-integrity@vger.kernel.org, selinux@vger.kernel.org, Christian Brauner Subject: [PATCH v6 30/40] mount: make {lock,unlock}_mount_hash() static Date: Thu, 21 Jan 2021 14:19:49 +0100 Message-Id: <20210121131959.646623-31-christian.brauner@ubuntu.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210121131959.646623-1-christian.brauner@ubuntu.com> References: <20210121131959.646623-1-christian.brauner@ubuntu.com> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=vO6mqD1pvztvOW1otxIX/33XHCNZr+llU/zGWpmgRcU=; m=KhvaMUT1cjYCcf89U9v9dgojtWEDCI7+j8N/vrPJ2d8=; p=m+f5GyiYf302pJENuNE7M1OLXAwtO2DVQ+DZIMIfwu0=; g=a01f7f9b00b67a1698d6ed6ffbed46e285973451 X-Patch-Sig: m=pgp; i=christian.brauner@ubuntu.com; s=0x0x91C61BC06578DCA2; b=iHUEABYKAB0WIQRAhzRXHqcMeLMyaSiRxhvAZXjcogUCYAl9pgAKCRCRxhvAZXjcov5nAP417zG 11bQQEUJ0ysdrJok04PLyXR+Mhb6D2/2E4h91CgEAijXaDc6Gi6RigHFF4y2Xjov9EzuvRHTYz5It xL3Ybgw= Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org The lock_mount_hash() and unlock_mount_hash() helpers are never called outside a single file. Remove them from the header and make them static to reflect this fact. There's no need to have them callable from other places right now, as Christoph observed. Link: https://lore.kernel.org/r/20210112220124.837960-3-christian.brauner@ubuntu.com Cc: David Howells Cc: Al Viro Cc: linux-fsdevel@vger.kernel.org Suggested-by: Christoph Hellwig Reviewed-by: Christoph Hellwig Signed-off-by: Christian Brauner --- /* v2 */ - Christoph Hellwig : - Add a patch to make {lock,unlock)_mount_hash() static. /* v3 */ unchanged /* v4 */ unchanged /* v5 */ unchanged base-commit: 7c53f6b671f4aba70ff15e1b05148b10d58c2837 /* v6 */ unchanged base-commit: 19c329f6808995b142b3966301f217c831e7cf31 --- fs/mount.h | 10 ---------- fs/namespace.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/fs/mount.h b/fs/mount.h index ce6c376e0bc2..0b6e08cf8afb 100644 --- a/fs/mount.h +++ b/fs/mount.h @@ -124,16 +124,6 @@ static inline void get_mnt_ns(struct mnt_namespace *ns) extern seqlock_t mount_lock; -static inline void lock_mount_hash(void) -{ - write_seqlock(&mount_lock); -} - -static inline void unlock_mount_hash(void) -{ - write_sequnlock(&mount_lock); -} - struct proc_mounts { struct mnt_namespace *ns; struct path root; diff --git a/fs/namespace.c b/fs/namespace.c index bdfb130f2c3c..5fceb2854395 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -87,6 +87,16 @@ EXPORT_SYMBOL_GPL(fs_kobj); */ __cacheline_aligned_in_smp DEFINE_SEQLOCK(mount_lock); +static inline void lock_mount_hash(void) +{ + write_seqlock(&mount_lock); +} + +static inline void unlock_mount_hash(void) +{ + write_sequnlock(&mount_lock); +} + static inline struct hlist_head *m_hash(struct vfsmount *mnt, struct dentry *dentry) { unsigned long tmp = ((unsigned long)mnt / L1_CACHE_BYTES); -- 2.30.0