From: Zizhi Wo <wozizhi@huaweicloud.com>
To: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: yangerkun@huawei.com, wozizhi@huaweicloud.com
Subject: [PATCH] fs: Rename the parameter of mnt_get_write_access()
Date: Fri, 16 May 2025 11:21:47 +0800 [thread overview]
Message-ID: <20250516032147.3350598-1-wozizhi@huaweicloud.com> (raw)
From: Zizhi Wo <wozizhi@huawei.com>
Rename the parameter in mnt_get_write_access() from "m" to "mnt" for
consistency between declaration and implementation.
Signed-off-by: Zizhi Wo <wozizhi@huawei.com>
---
fs/namespace.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/fs/namespace.c b/fs/namespace.c
index 1b466c54a357..b1b679433ab3 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -483,7 +483,7 @@ static int mnt_is_readonly(struct vfsmount *mnt)
*/
/**
* mnt_get_write_access - get write access to a mount without freeze protection
- * @m: the mount on which to take a write
+ * @mnt: the mount on which to take a write
*
* This tells the low-level filesystem that a write is about to be performed to
* it, and makes sure that writes are allowed (mnt it read-write) before
@@ -491,13 +491,13 @@ static int mnt_is_readonly(struct vfsmount *mnt)
* frozen. When the write operation is finished, mnt_put_write_access() must be
* called. This is effectively a refcount.
*/
-int mnt_get_write_access(struct vfsmount *m)
+int mnt_get_write_access(struct vfsmount *mnt)
{
- struct mount *mnt = real_mount(m);
+ struct mount *m = real_mount(mnt);
int ret = 0;
preempt_disable();
- mnt_inc_writers(mnt);
+ mnt_inc_writers(m);
/*
* The store to mnt_inc_writers must be visible before we pass
* MNT_WRITE_HOLD loop below, so that the slowpath can see our
@@ -505,7 +505,7 @@ int mnt_get_write_access(struct vfsmount *m)
*/
smp_mb();
might_lock(&mount_lock.lock);
- while (READ_ONCE(mnt->mnt.mnt_flags) & MNT_WRITE_HOLD) {
+ while (READ_ONCE(m->mnt.mnt_flags) & MNT_WRITE_HOLD) {
if (!IS_ENABLED(CONFIG_PREEMPT_RT)) {
cpu_relax();
} else {
@@ -530,8 +530,8 @@ int mnt_get_write_access(struct vfsmount *m)
* read-only.
*/
smp_rmb();
- if (mnt_is_readonly(m)) {
- mnt_dec_writers(mnt);
+ if (mnt_is_readonly(mnt)) {
+ mnt_dec_writers(m);
ret = -EROFS;
}
preempt_enable();
--
2.39.2
next reply other threads:[~2025-05-16 3:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-16 3:21 Zizhi Wo [this message]
2025-05-16 10:31 ` [PATCH] fs: Rename the parameter of mnt_get_write_access() Jan Kara
2025-05-16 23:54 ` Zizhi Wo
2025-05-16 23:57 ` Al Viro
2025-05-17 0:09 ` Zizhi Wo
2025-05-22 1:01 ` Zizhi Wo
2025-05-22 7:41 ` Amir Goldstein
2025-05-22 8:02 ` Zizhi Wo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250516032147.3350598-1-wozizhi@huaweicloud.com \
--to=wozizhi@huaweicloud.com \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=yangerkun@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).