]> git.proxmox.com Git - mirror_ubuntu-kernels.git/blobdiff - fs/ext4/page-io.c
Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git...
[mirror_ubuntu-kernels.git] / fs / ext4 / page-io.c
index 40b7d8485b44560a7cc91f4aa999216c8cfc4089..14695e2b5042ba5e6dbb594ecff5238899c8d955 100644 (file)
@@ -325,10 +325,9 @@ static void ext4_end_bio(struct bio *bio)
 {
        ext4_io_end_t *io_end = bio->bi_private;
        sector_t bi_sector = bio->bi_iter.bi_sector;
-       char b[BDEVNAME_SIZE];
 
-       if (WARN_ONCE(!io_end, "io_end is NULL: %s: sector %Lu len %u err %d\n",
-                     bio_devname(bio, b),
+       if (WARN_ONCE(!io_end, "io_end is NULL: %pg: sector %Lu len %u err %d\n",
+                     bio->bi_bdev,
                      (long long) bio->bi_iter.bi_sector,
                      (unsigned) bio_sectors(bio),
                      bio->bi_status)) {
@@ -374,10 +373,8 @@ 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;
-               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);
+               if (io->io_wbc->sync_mode == WB_SYNC_ALL)
+                       io->io_bio->bi_opf |= REQ_SYNC;
                submit_bio(io->io_bio);
        }
        io->io_bio = NULL;
@@ -400,10 +397,9 @@ 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(GFP_NOIO, BIO_MAX_VECS);
+       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_set_dev(bio, bh->b_bdev);
        bio->bi_end_io = ext4_end_bio;
        bio->bi_private = ext4_get_io_end(io->io_end);
        io->io_bio = bio;
@@ -423,10 +419,8 @@ static void io_submit_add_bh(struct ext4_io_submit *io,
 submit_and_retry:
                ext4_io_submit(io);
        }
-       if (io->io_bio == NULL) {
+       if (io->io_bio == NULL)
                io_submit_init_bio(io, bh);
-               io->io_bio->bi_write_hint = inode->i_write_hint;
-       }
        ret = bio_add_page(io->io_bio, page, bh->b_size, bh_offset(bh));
        if (ret != bh->b_size)
                goto submit_and_retry;