From: Filipe Manana <fdmanana@kernel.org>
To: Naohiro Aota <naohiro.aota@wdc.com>
Cc: linux-btrfs@vger.kernel.org, johannes.thumshirn@wdc.com,
Filipe Manana <fdmanana@suse.com>
Subject: Re: [PATCH v3 2/3] fs: add check functions for sb_start_{write,pagefault,intwrite}
Date: Mon, 28 Mar 2022 11:40:44 +0100 [thread overview]
Message-ID: <YkGQrPMhoe64lD1R@debian9.Home> (raw)
In-Reply-To: <5a8a19efe9f19b3e11026f57835614731aeeb62d.1648448228.git.naohiro.aota@wdc.com>
On Mon, Mar 28, 2022 at 03:29:21PM +0900, Naohiro Aota wrote:
> Add a function sb_write_started() to return if sb_start_write() is
> properly called. It is used in the next commit.
>
> Reviewed-by: Filipe Manana <fdmanana@suse.com>
> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
> ---
> include/linux/fs.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 27746a3da8fd..57fedc4af4a1 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -1732,6 +1732,11 @@ static inline bool __sb_start_write_trylock(struct super_block *sb, int level)
> #define __sb_writers_release(sb, lev) \
> percpu_rwsem_release(&(sb)->s_writers.rw_sem[(lev)-1], 1, _THIS_IP_)
>
> +static inline bool sb_write_started(struct super_block *sb)
The argument can be made const.
Also, the subject "fs: add check functions for sb_start_{write,pagefault,intwrite}" is
now oudated, since only sb_write_started() is added.
Thanks.
> +{
> + return lockdep_is_held_type(sb->s_writers.rw_sem + SB_FREEZE_WRITE - 1, 1);
> +}
> +
> /**
> * sb_end_write - drop write access to a superblock
> * @sb: the super we wrote to
> --
> 2.35.1
>
next prev parent reply other threads:[~2022-03-28 10:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-28 6:29 [PATCH v3 0/3] protect relocation with sb_start_write Naohiro Aota
2022-03-28 6:29 ` [PATCH v3 1/3] btrfs: mark resumed async balance as writing Naohiro Aota
2022-03-28 6:29 ` [PATCH v3 2/3] fs: add check functions for sb_start_{write,pagefault,intwrite} Naohiro Aota
2022-03-28 10:40 ` Filipe Manana [this message]
2022-03-28 6:29 ` [PATCH v3 3/3] btrfs: assert that relocation is protected with sb_start_write() Naohiro Aota
2022-03-28 10:49 ` Filipe Manana
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=YkGQrPMhoe64lD1R@debian9.Home \
--to=fdmanana@kernel.org \
--cc=fdmanana@suse.com \
--cc=johannes.thumshirn@wdc.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=naohiro.aota@wdc.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