[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f6a9c6ef-1fd8-41d2-8f6a-396b6b191f97@huaweicloud.com>
Date: Thu, 22 May 2025 09:01:56 +0800
From: Zizhi Wo <wozizhi@...weicloud.com>
To: Zizhi Wo <wozizhi@...weicloud.com>, viro@...iv.linux.org.uk,
brauner@...nel.org, jack@...e.cz, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: yangerkun@...wei.com
Subject: Re: [PATCH] fs: Rename the parameter of mnt_get_write_access()
Hello!
There are currently two possible approaches to this patch.
The first is to directly change the declaration, which would be
straightforward and involve minimal modifications.
However, per Al Viro's suggestion — that "mnt for vfsmount, m for mount"
is an informal convention. This is in line with what the current
patch does, although I understand Jan Kara might feel that the scope of
the changes is a bit large.
I would appreciate any suggestions or guidance on how to proceed. So
friendly ping...
在 2025/5/16 11:21, Zizhi Wo 写道:
> From: Zizhi Wo <wozizhi@...wei.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@...wei.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();
Powered by blists - more mailing lists