Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ext4: factor out a io_submit_need_new_bio helper

Factor out a helper to prepare for making this logic a bit more
complex in the next commit.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20260302141922.370070-4-hch@lst.de
Signed-off-by: Eric Biggers <ebiggers@kernel.org>

authored by

Christoph Hellwig and committed by
Eric Biggers
5f18a9d2 d3fc0edc

+11 -2
+11 -2
fs/ext4/page-io.c
··· 439 439 wbc_init_bio(io->io_wbc, bio); 440 440 } 441 441 442 + static bool io_submit_need_new_bio(struct ext4_io_submit *io, 443 + struct buffer_head *bh) 444 + { 445 + if (bh->b_blocknr != io->io_next_block) 446 + return true; 447 + if (!fscrypt_mergeable_bio_bh(io->io_bio, bh)) 448 + return true; 449 + return false; 450 + } 451 + 442 452 static void io_submit_add_bh(struct ext4_io_submit *io, 443 453 struct inode *inode, 444 454 struct folio *folio, 445 455 struct folio *io_folio, 446 456 struct buffer_head *bh) 447 457 { 448 - if (io->io_bio && (bh->b_blocknr != io->io_next_block || 449 - !fscrypt_mergeable_bio_bh(io->io_bio, bh))) { 458 + if (io->io_bio && io_submit_need_new_bio(io, bh)) { 450 459 submit_and_retry: 451 460 ext4_io_submit(io); 452 461 }