summaryrefslogtreecommitdiff
path: root/fs/ext4
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-03-21 17:21:05 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2022-03-21 17:21:05 -0700
commitd347ee54a70e45c082ca7a373fbdf0c34109d575 (patch)
tree0d709b0634915b0e71fe33cd47ec8d117d42791f /fs/ext4
parent69d1dea852b54eecd8ad2ec92a7fd371e9aec4bd (diff)
parent64bf0eef0171912f7c2f3ea30ee6ad7a2ad0a511 (diff)
Merge tag 'for-5.18/alloc-cleanups-2022-03-18' of git://git.kernel.dk/linux-block
Pull bio_alloc() cleanups from Jens Axboe: "Filesystem cleanups to pass the bio op to bio_alloc() instead of setting it just before bio submission". * tag 'for-5.18/alloc-cleanups-2022-03-18' of git://git.kernel.dk/linux-block: f2fs: pass the bio operation to bio_alloc_bioset f2fs: don't pass a bio to f2fs_target_device nilfs2: pass the operation to bio_alloc ext4: pass the operation to bio_alloc mpage: pass the operation to bio_alloc
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/page-io.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
index 18373fa52922..17bb78ebd784 100644
--- a/fs/ext4/page-io.c
+++ b/fs/ext4/page-io.c
@@ -371,10 +371,9 @@ void ext4_io_submit(struct ext4_io_submit *io)
struct bio *bio = io->io_bio;
if (bio) {
- int io_op_flags = io->io_wbc->sync_mode == WB_SYNC_ALL ?
- REQ_SYNC : 0;
+ if (io->io_wbc->sync_mode == WB_SYNC_ALL)
+ io->io_bio->bi_opf |= REQ_SYNC;
io->io_bio->bi_write_hint = io->io_end->inode->i_write_hint;
- bio_set_op_attrs(io->io_bio, REQ_OP_WRITE, io_op_flags);
submit_bio(io->io_bio);
}
io->io_bio = NULL;
@@ -397,7 +396,7 @@ static void io_submit_init_bio(struct ext4_io_submit *io,
* bio_alloc will _always_ be able to allocate a bio if
* __GFP_DIRECT_RECLAIM is set, see comments for bio_alloc_bioset().
*/
- bio = bio_alloc(bh->b_bdev, BIO_MAX_VECS, 0, GFP_NOIO);
+ bio = bio_alloc(bh->b_bdev, BIO_MAX_VECS, REQ_OP_WRITE, GFP_NOIO);
fscrypt_set_bio_crypt_ctx_bh(bio, bh, GFP_NOIO);
bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9);
bio->bi_end_io = ext4_end_bio;