diff options
| author | Christoph Hellwig <hch@lst.de> | 2026-03-02 06:18:08 -0800 |
|---|---|---|
| committer | Eric Biggers <ebiggers@kernel.org> | 2026-03-09 13:31:50 -0700 |
| commit | 5f18a9d2f75a3a5c055c2d777a29b3aa322b04da (patch) | |
| tree | d6b4ab4f425c69cc144679477a2e083234649a6f /fs/ext4 | |
| parent | d3fc0edc8825f39c86dcc4a8b8544f6e25680a51 (diff) | |
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>
Diffstat (limited to 'fs/ext4')
| -rw-r--r-- | fs/ext4/page-io.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index c5ca99b33c26..58cdbd836fd6 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c @@ -439,14 +439,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); } |
