Re: [PATCH 01/14] ext4: initialize the write hint in io_submit_init_bio

Eric Biggers <[email protected]>
Newsgroups org.kernel.vger.linux-fscrypt,net.sourceforge.lists.linux-f2fs-devel,org.kernel.vger.linux-ext4,org.kernel.vger.linux-fsdevel
Message-ID <20260227211639.GA2659@quark>
On Thu, Feb 26, 2026 at 06:49:21AM -0800, Christoph Hellwig wrote:
> Make io_submit_init_bio complete by also initializing the write hint.
> 
> Signed-off-by: Christoph Hellwig <[email protected]>
> ---
>  fs/ext4/page-io.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
> index a8c95eee91b7..a3644d6cb65f 100644
> --- a/fs/ext4/page-io.c
> +++ b/fs/ext4/page-io.c
> @@ -416,6 +416,7 @@ void ext4_io_submit_init(struct ext4_io_submit *io,
>  }
>  
>  static void io_submit_init_bio(struct ext4_io_submit *io,
> +			       struct inode *inode,
>  			       struct buffer_head *bh)
>  {
>  	struct bio *bio;
> @@ -430,6 +431,7 @@ static void io_submit_init_bio(struct ext4_io_submit *io,
>  	bio->bi_end_io = ext4_end_bio;
>  	bio->bi_private = ext4_get_io_end(io->io_end);
>  	io->io_bio = bio;
> +	io->io_bio->bi_write_hint = inode->i_write_hint;
>  	io->io_next_block = bh->b_blocknr;
>  	wbc_init_bio(io->io_wbc, bio);
>  }

Maybe make this consistent with the other initializations by moving it
up a line and doing:

        bio->bi_write_hint = inode->i_write_hint;

- Eric
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.