Skip to content

Commit 813f853

Browse files
tracy2015tytso
authored andcommitted
ext4: pass write-hint for buffered IO
Commit 4498135 ("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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 2f3d93e commit 813f853

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/ext4/page-io.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,10 @@ static void io_submit_add_bh(struct ext4_io_submit *io,
417417
submit_and_retry:
418418
ext4_io_submit(io);
419419
}
420-
if (io->io_bio == NULL)
420+
if (io->io_bio == NULL) {
421421
io_submit_init_bio(io, bh);
422+
io->io_bio->bi_write_hint = inode->i_write_hint;
423+
}
422424
if (!bio_add_folio(io->io_bio, io_folio, bh->b_size, bh_offset(bh)))
423425
goto submit_and_retry;
424426
wbc_account_cgroup_owner(io->io_wbc, &folio->page, bh->b_size);

0 commit comments

Comments
 (0)