MIPS: ATH79: Set missing irq ack handler for ar7100-misc-intc irq chip
[linux-drm-fsl-dcu.git] / fs / ext4 / page-io.c
index 8a9d63a0c0710378a46c62ca532734c77fd53291..84ba4d2b3a35f58158b8e1c49b57ed74d806c569 100644 (file)
@@ -354,8 +354,10 @@ void ext4_io_submit(struct ext4_io_submit *io)
        struct bio *bio = io->io_bio;
 
        if (bio) {
+               int io_op = io->io_wbc->sync_mode == WB_SYNC_ALL ?
+                           WRITE_SYNC : WRITE;
                bio_get(io->io_bio);
-               submit_bio(io->io_op, io->io_bio);
+               submit_bio(io_op, io->io_bio);
                bio_put(io->io_bio);
        }
        io->io_bio = NULL;
@@ -364,7 +366,7 @@ void ext4_io_submit(struct ext4_io_submit *io)
 void ext4_io_submit_init(struct ext4_io_submit *io,
                         struct writeback_control *wbc)
 {
-       io->io_op = (wbc->sync_mode == WB_SYNC_ALL ?  WRITE_SYNC : WRITE);
+       io->io_wbc = wbc;
        io->io_bio = NULL;
        io->io_end = NULL;
 }
@@ -377,6 +379,7 @@ static int io_submit_init_bio(struct ext4_io_submit *io,
        bio = bio_alloc(GFP_NOIO, BIO_MAX_PAGES);
        if (!bio)
                return -ENOMEM;
+       wbc_init_bio(io->io_wbc, bio);
        bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9);
        bio->bi_bdev = bh->b_bdev;
        bio->bi_end_io = ext4_end_bio;
@@ -405,6 +408,7 @@ submit_and_retry:
        ret = bio_add_page(io->io_bio, page, bh->b_size, bh_offset(bh));
        if (ret != bh->b_size)
                goto submit_and_retry;
+       wbc_account_io(io->io_wbc, page, bh->b_size);
        io->io_next_block++;
        return 0;
 }