Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp26711pxb; Tue, 12 Jan 2021 18:57:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwS+X63J2/lKxdPUJgexvJdAcX2Zfc5rGQxQ5DDDzEnuN35++JLXR5e/QDkzXZR8PBABnU2 X-Received: by 2002:a17:906:3111:: with SMTP id 17mr8753ejx.152.1610506619854; Tue, 12 Jan 2021 18:56:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610506619; cv=none; d=google.com; s=arc-20160816; b=lsMydgb7xw0bno58QOOEeFG1Ivk3lvzhfystj0EGGb2e2u0QPzE2p8FlYHfh8vf2Pg ji5tI34Br4DzflI3zwYIwxBQsbEs2a6bYb8ot3TI/XeW6qMycH/uzIThyDLpI3UlEsEB 7j+HDYxTO4bPF7yBVO5guff3jbxh9DN4aQlPmym25dRJwge20rcvvbCtOTUaOaVCIMcb DhsdiSI4575ujiFoElflcBawB7tZV2dQrYssnfmcUeJtEqXXWZH5vtq+Bvw9o/VdduCy 8Qg+ZhchPMMmcYcuxzxsK8coCYHhh6vcHg/H2yO1/mkXWwMw98eOiGdSQWoyX71K12AQ oFGw== 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=HIFSS5Tcju1QDfbvCRu42WF6846ixtyKCQCZ/in1NAU=; b=G9YJcvDu6a2aN/ha0PErP8S9t/aXE6rEnBzDkhCQYFEcQzqbr3yfdQFaSkdcO8m0aL 4MJJk7gF3CPDmLc5ssz3pasfZkVl2dZ5MmhwWjMFSD+kIEidjrgiqTZByXhYXdOwlHQa UQULYZ+oM8G1XRRypaxCgXHaPdOGEIvFvhJTp7nmSbshfYJGuPN6w4smuYfAZCrSoxHx 48DTRm7jr34ZLKezTB1TQGOKGCCPeGrvIsPcdCzum1yGr/Hp5h8BERf/8//S0hd9bSpv oQixSYHscTySOaatH/0sYh+6+g9KWXIBuhr5rcQJ0BDhE4VJIjpljDvILSB+MjqPUfnl SmEw== 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 b11si290447ede.511.2021.01.12.18.56.36; Tue, 12 Jan 2021 18:56: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 S2393855AbhALWDf (ORCPT + 99 others); Tue, 12 Jan 2021 17:03:35 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:42903 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393848AbhALWDe (ORCPT ); Tue, 12 Jan 2021 17:03:34 -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 1kzRkU-0003bd-R2; Tue, 12 Jan 2021 22:02:46 +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 , Christoph Hellwig Subject: [PATCH v5 02/42] mount: make {lock,unlock}_mount_hash() static Date: Tue, 12 Jan 2021 23:00:44 +0100 Message-Id: <20210112220124.837960-3-christian.brauner@ubuntu.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210112220124.837960-1-christian.brauner@ubuntu.com> References: <20210112220124.837960-1-christian.brauner@ubuntu.com> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=vO6mqD1pvztvOW1otxIX/33XHCNZr+llU/zGWpmgRcU=; m=urR2rAIlQm7B+Wnhux1HQqMBhK+gzFRqnuakSaYsLEw=; p=FzHd8xIvHJqF6DeGhIkxr3GWqyk+wfjD+OZpRToKI4o=; g=a01f7f9b00b67a1698d6ed6ffbed46e285973451 X-Patch-Sig: m=pgp; i=christian.brauner@ubuntu.com; s=0x0x91C61BC06578DCA2; b=iHUEABYKAB0WIQRAhzRXHqcMeLMyaSiRxhvAZXjcogUCX/4YtQAKCRCRxhvAZXjcorMkAQDuVqe kjayCqPe3qytw6oZ7nOgpZjngGZBcdjtF8EvVmQD/TTQi6iRuXo2TWtRa3j82P+plXgb3Vj3OCV7l LedXkwo= 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. Suggested-by: Christoph Hellwig Cc: David Howells Cc: Al Viro Cc: linux-fsdevel@vger.kernel.org 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 */ base-commit: 7c53f6b671f4aba70ff15e1b05148b10d58c2837 --- 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 dc782ddf603e..8cb2c132525a 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