Factor out a helper to prepare for making this logic a bit more complex in the next commit.
Signed-off-by: Christoph Hellwig <[email protected]> --- fs/ext4/page-io.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index 851d1267054a..88226979c503 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c @@ -440,14 +440,23 @@ static void io_submit_init_bio(struct ext4_io_submit *io, wbc_init_bio(io->io_wbc, bio); } +static bool io_submit_need_new_bio(struct ext4_io_submit *io, + struct buffer_head *bh) +{ + if (bh->b_blocknr != io->io_next_block) + return true; + if (!fscrypt_mergeable_bio_bh(io->io_bio, bh)) + return true; + return false; +} + static void io_submit_add_bh(struct ext4_io_submit *io, struct inode *inode, struct folio *folio, struct folio *io_folio, struct buffer_head *bh) { - if (io->io_bio && (bh->b_blocknr != io->io_next_block || - !fscrypt_mergeable_bio_bh(io->io_bio, bh))) { + if (io->io_bio && io_submit_need_new_bio(io, bh)) { submit_and_retry: ext4_io_submit(io); } -- 2.47.3 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
