diff options
author | j.xia <j.xia@samsung.com> | 2024-09-19 04:03:41 +0200 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2024-11-13 05:54:14 +0100 |
commit | 813f85360404028cd8340ae7f7f77abc68c86fbc (patch) | |
tree | 6081ca5631ffee2aba5c90e594474622c59efb59 /fs/ext4 | |
parent | ext4: fix race in buffer_head read fault injection (diff) | |
download | linux-813f85360404028cd8340ae7f7f77abc68c86fbc.tar.xz linux-813f85360404028cd8340ae7f7f77abc68c86fbc.zip |
ext4: pass write-hint for buffered IO
Commit 449813515d3e ("block, fs: Restore the per-bio/request data
lifetime fields") restored write-hint support in ext4. But that is
applicable only for direct IO. This patch supports passing
write-hint for buffered IO from ext4 file system to block layer
by filling bi_write_hint of struct bio in io_submit_add_bh().
Signed-off-by: j.xia <j.xia@samsung.com>
Link: https://patch.msgid.link/20240919020341.2657646-1-j.xia@samsung.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/page-io.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index ad5543866d21..bb8b17c394d4 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c @@ -417,8 +417,10 @@ static void io_submit_add_bh(struct ext4_io_submit *io, submit_and_retry: ext4_io_submit(io); } - if (io->io_bio == NULL) + if (io->io_bio == NULL) { io_submit_init_bio(io, bh); + io->io_bio->bi_write_hint = inode->i_write_hint; + } if (!bio_add_folio(io->io_bio, io_folio, bh->b_size, bh_offset(bh))) goto submit_and_retry; wbc_account_cgroup_owner(io->io_wbc, &folio->page, bh->b_size); |