]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
block: prep work for batch completion
authorKent Overstreet <koverstreet@google.com>
Sat, 23 Mar 2013 02:33:17 +0000 (13:33 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 26 Mar 2013 05:22:35 +0000 (16:22 +1100)
Add a struct batch_complete * argument to bi_end_io; infrastructure to
make use of it comes in the next patch.

Signed-off-by: Kent Overstreet <koverstreet@google.com>
Cc: Zach Brown <zab@redhat.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Asai Thambi S P <asamymuthupa@micron.com>
Cc: Selvan Mani <smani@micron.com>
Cc: Sam Bradshaw <sbradshaw@micron.com>
Cc: Jeff Moyer <jmoyer@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Benjamin LaHaise <bcrl@kvack.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
55 files changed:
block/blk-flush.c
block/blk-lib.c
drivers/block/drbd/drbd_bitmap.c
drivers/block/drbd/drbd_worker.c
drivers/block/drbd/drbd_wrappers.h
drivers/block/floppy.c
drivers/block/pktcdvd.c
drivers/block/xen-blkback/blkback.c
drivers/md/dm-bufio.c
drivers/md/dm-crypt.c
drivers/md/dm-io.c
drivers/md/dm-snap.c
drivers/md/dm-thin.c
drivers/md/dm-verity.c
drivers/md/dm.c
drivers/md/faulty.c
drivers/md/md.c
drivers/md/multipath.c
drivers/md/raid1.c
drivers/md/raid10.c
drivers/md/raid5.c
drivers/target/target_core_iblock.c
drivers/target/target_core_pscsi.c
fs/bio-integrity.c
fs/bio.c
fs/btrfs/check-integrity.c
fs/btrfs/compression.c
fs/btrfs/disk-io.c
fs/btrfs/extent_io.c
fs/btrfs/inode.c
fs/btrfs/scrub.c
fs/btrfs/volumes.c
fs/buffer.c
fs/direct-io.c
fs/ext4/page-io.c
fs/f2fs/data.c
fs/f2fs/segment.c
fs/gfs2/lops.c
fs/gfs2/ops_fstype.c
fs/hfsplus/wrapper.c
fs/jfs/jfs_logmgr.c
fs/jfs/jfs_metapage.c
fs/logfs/dev_bdev.c
fs/mpage.c
fs/nfs/blocklayout/blocklayout.c
fs/nilfs2/segbuf.c
fs/ocfs2/cluster/heartbeat.c
fs/xfs/xfs_aops.c
fs/xfs/xfs_buf.c
include/linux/bio.h
include/linux/blk_types.h
include/linux/fs.h
include/linux/swap.h
mm/bounce.c
mm/page_io.c

index cc2b827a853cdea378f1c54edeadd65546b33651..762cfcac839558eb720c3aee92ab0921f0e2dd9e 100644 (file)
@@ -384,7 +384,8 @@ void blk_abort_flushes(struct request_queue *q)
        }
 }
 
-static void bio_end_flush(struct bio *bio, int err)
+static void bio_end_flush(struct bio *bio, int err,
+                         struct batch_complete *batch)
 {
        if (err)
                clear_bit(BIO_UPTODATE, &bio->bi_flags);
index d6f50d572565ad41a730ec531ea4849a6ef042bb..279f9de415be35f31fd997d2bdf7718b684426de 100644 (file)
@@ -15,7 +15,8 @@ struct bio_batch {
        struct completion       *wait;
 };
 
-static void bio_batch_end_io(struct bio *bio, int err)
+static void bio_batch_end_io(struct bio *bio, int err,
+                            struct batch_complete *batch)
 {
        struct bio_batch *bb = bio->bi_private;
 
index 64fbb8385cdc87575ce499d888919ac3cb52b81e..c01f27d571a7cbc168bb1520a334735e89baaa54 100644 (file)
@@ -948,7 +948,7 @@ static void bm_aio_ctx_destroy(struct kref *kref)
 }
 
 /* bv_page may be a copy, or may be the original */
-static void bm_async_io_complete(struct bio *bio, int error)
+static void bm_async_io_complete(struct bio *bio, int error, struct batch_complete *batch)
 {
        struct bm_aio_ctx *ctx = bio->bi_private;
        struct drbd_conf *mdev = ctx->mdev;
index f41e224caa7c9528ecf1b987e28840c9a8504d12..19bc492b2d98f3e7ca7935ab349c8106136f235e 100644 (file)
@@ -64,7 +64,7 @@ rwlock_t global_state_lock;
 /* used for synchronous meta data and bitmap IO
  * submitted by drbd_md_sync_page_io()
  */
-void drbd_md_io_complete(struct bio *bio, int error)
+void drbd_md_io_complete(struct bio *bio, int error, struct batch_complete *batch)
 {
        struct drbd_md_io *md_io;
        struct drbd_conf *mdev;
@@ -167,7 +167,7 @@ static void drbd_endio_write_sec_final(struct drbd_peer_request *peer_req) __rel
 /* writes on behalf of the partner, or resync writes,
  * "submitted" by the receiver.
  */
-void drbd_peer_request_endio(struct bio *bio, int error)
+void drbd_peer_request_endio(struct bio *bio, int error, struct batch_complete *batch)
 {
        struct drbd_peer_request *peer_req = bio->bi_private;
        struct drbd_conf *mdev = peer_req->w.mdev;
@@ -203,7 +203,7 @@ void drbd_peer_request_endio(struct bio *bio, int error)
 
 /* read, readA or write requests on R_PRIMARY coming from drbd_make_request
  */
-void drbd_request_endio(struct bio *bio, int error)
+void drbd_request_endio(struct bio *bio, int error, struct batch_complete *batch)
 {
        unsigned long flags;
        struct drbd_request *req = bio->bi_private;
index 328f18e4b4eedb3cc0faf85fdbca183cae5f52e0..d443dc06b8543fc79012afd848ac1be0e56470cf 100644 (file)
@@ -20,9 +20,12 @@ static inline void drbd_set_my_capacity(struct drbd_conf *mdev,
 #define drbd_bio_uptodate(bio) bio_flagged(bio, BIO_UPTODATE)
 
 /* bi_end_io handlers */
-extern void drbd_md_io_complete(struct bio *bio, int error);
-extern void drbd_peer_request_endio(struct bio *bio, int error);
-extern void drbd_request_endio(struct bio *bio, int error);
+extern void drbd_md_io_complete(struct bio *bio, int error,
+                               struct batch_complete *batch);
+extern void drbd_peer_request_endio(struct bio *bio, int error,
+                                   struct batch_complete *batch);
+extern void drbd_request_endio(struct bio *bio, int error,
+                              struct batch_complete *batch);
 
 /*
  * used to submit our private bio
index 83232639034eda69da39d8f84eb60e8f63339538..629b6d506cd0ec0cf72c2d04d8bc2b1b7ac942af 100644 (file)
@@ -3748,7 +3748,8 @@ static unsigned int floppy_check_events(struct gendisk *disk,
  * a disk in the drive, and whether that disk is writable.
  */
 
-static void floppy_rb0_complete(struct bio *bio, int err)
+static void floppy_rb0_complete(struct bio *bio, int err,
+                               struct batch_complete *batch)
 {
        complete((struct completion *)bio->bi_private);
 }
index 11190424536a95a8cf1ca3eb84a46fc396930e69..2441bfb048a9e00acb23ca6a39c0a19e9697c467 100644 (file)
@@ -980,7 +980,8 @@ static void pkt_make_local_copy(struct packet_data *pkt, struct bio_vec *bvec)
        }
 }
 
-static void pkt_end_io_read(struct bio *bio, int err)
+static void pkt_end_io_read(struct bio *bio, int err,
+                           struct batch_complete *batch)
 {
        struct packet_data *pkt = bio->bi_private;
        struct pktcdvd_device *pd = pkt->pd;
@@ -998,7 +999,8 @@ static void pkt_end_io_read(struct bio *bio, int err)
        pkt_bio_finished(pd);
 }
 
-static void pkt_end_io_packet_write(struct bio *bio, int err)
+static void pkt_end_io_packet_write(struct bio *bio, int err,
+                                   struct batch_complete *batch)
 {
        struct packet_data *pkt = bio->bi_private;
        struct pktcdvd_device *pd = pkt->pd;
@@ -2339,7 +2341,8 @@ static int pkt_close(struct gendisk *disk, fmode_t mode)
 }
 
 
-static void pkt_end_io_read_cloned(struct bio *bio, int err)
+static void pkt_end_io_read_cloned(struct bio *bio, int err,
+                                  struct batch_complete *batch)
 {
        struct packet_stacked_data *psd = bio->bi_private;
        struct pktcdvd_device *pd = psd->pd;
index dd5b2fed97e9ae2b7665f13ec3c42db6ee6fb462..990c1d81849f13f4dc5fdc6d56bd69ca0cadf48b 100644 (file)
@@ -741,7 +741,8 @@ static void __end_block_io_op(struct pending_req *pending_req, int error)
 /*
  * bio callback.
  */
-static void end_block_io_op(struct bio *bio, int error)
+static void end_block_io_op(struct bio *bio, int error,
+                           struct batch_complete *batch)
 {
        __end_block_io_op(bio->bi_private, error);
        bio_put(bio);
index c6083132c4b8ccaf21c7addb61cf8596165bf915..6f1b57ab886833fb6723b902f83c8374ca371665 100644 (file)
@@ -472,7 +472,7 @@ static void dmio_complete(unsigned long error, void *context)
 {
        struct dm_buffer *b = context;
 
-       b->bio.bi_end_io(&b->bio, error ? -EIO : 0);
+       b->bio.bi_end_io(&b->bio, error ? -EIO : 0, NULL);
 }
 
 static void use_dmio(struct dm_buffer *b, int rw, sector_t block,
@@ -503,7 +503,7 @@ static void use_dmio(struct dm_buffer *b, int rw, sector_t block,
 
        r = dm_io(&io_req, 1, &region, NULL);
        if (r)
-               end_io(&b->bio, r);
+               end_io(&b->bio, r, NULL);
 }
 
 static void use_inline_bio(struct dm_buffer *b, int rw, sector_t block,
@@ -570,7 +570,8 @@ static void submit_io(struct dm_buffer *b, int rw, sector_t block,
  * Set the error, clear B_WRITING bit and wake anyone who was waiting on
  * it.
  */
-static void write_endio(struct bio *bio, int error)
+static void write_endio(struct bio *bio, int error,
+                       struct batch_complete *batch)
 {
        struct dm_buffer *b = container_of(bio, struct dm_buffer, bio);
 
@@ -943,7 +944,7 @@ found_buffer:
  * The endio routine for reading: set the error, clear the bit and wake up
  * anyone waiting on the buffer.
  */
-static void read_endio(struct bio *bio, int error)
+static void read_endio(struct bio *bio, int error, struct batch_complete *batch)
 {
        struct dm_buffer *b = container_of(bio, struct dm_buffer, bio);
 
index 6d2d41ae9e322dbd53e787e5294f2d55551296eb..ec0e3c0883b56355dd934c019db11b1c268ca7ab 100644 (file)
@@ -929,7 +929,8 @@ static void crypt_dec_pending(struct dm_crypt_io *io)
  * The work is done per CPU global for all dm-crypt instances.
  * They should not depend on each other and do not block.
  */
-static void crypt_endio(struct bio *clone, int error)
+static void crypt_endio(struct bio *clone, int error,
+                       struct batch_complete *batch)
 {
        struct dm_crypt_io *io = clone->bi_private;
        struct crypt_config *cc = io->cc;
index ea49834377c8e17b6e8b221e4bd58389a8d7c32e..a727b267f86d7454c94891da603c40453749cd38 100644 (file)
@@ -136,7 +136,7 @@ static void dec_count(struct io *io, unsigned int region, int error)
        }
 }
 
-static void endio(struct bio *bio, int error)
+static void endio(struct bio *bio, int error, struct batch_complete *batch)
 {
        struct io *io;
        unsigned region;
index c0e07026a8d136f084958800192c12236ffd37e2..eb32e35bca8f12269fe69197a1a7ac2c65c3e826 100644 (file)
@@ -1485,7 +1485,8 @@ static void start_copy(struct dm_snap_pending_exception *pe)
        dm_kcopyd_copy(s->kcopyd_client, &src, 1, &dest, 0, copy_callback, pe);
 }
 
-static void full_bio_end_io(struct bio *bio, int error)
+static void full_bio_end_io(struct bio *bio, int error,
+                           struct batch_complete *batch)
 {
        void *callback_data = bio->bi_private;
 
index 004ad1652b73477dae0194b957842434cf48c38d..905b75f60cc70f546d8418a35d6ed1395f88b64d 100644 (file)
@@ -553,7 +553,8 @@ static void copy_complete(int read_err, unsigned long write_err, void *context)
        spin_unlock_irqrestore(&pool->lock, flags);
 }
 
-static void overwrite_endio(struct bio *bio, int err)
+static void overwrite_endio(struct bio *bio, int err,
+                           struct batch_complete *batch)
 {
        unsigned long flags;
        struct dm_thin_endio_hook *h = dm_per_bio_data(bio, sizeof(struct dm_thin_endio_hook));
index b948fd864d457e9ce857d1d04fd74bf8997e0aee..b373bb7d1c2d429c1910670b7775b7b3ed2b9efb 100644 (file)
@@ -413,7 +413,8 @@ static void verity_work(struct work_struct *w)
        verity_finish_io(io, verity_verify_io(io));
 }
 
-static void verity_end_io(struct bio *bio, int error)
+static void verity_end_io(struct bio *bio, int error,
+                         struct batch_complete *batch)
 {
        struct dm_verity_io *io = bio->bi_private;
 
index 7e469260fe5eba5272ab56f74d9bd1c38fc2cfbf..a1e371a04ce7693262e37d463d7465fc914d2954 100644 (file)
@@ -616,7 +616,8 @@ static void dec_pending(struct dm_io *io, int error)
        }
 }
 
-static void clone_endio(struct bio *bio, int error)
+static void clone_endio(struct bio *bio, int error,
+                       struct batch_complete *batch)
 {
        int r = 0;
        struct dm_target_io *tio = bio->bi_private;
@@ -651,7 +652,8 @@ static void clone_endio(struct bio *bio, int error)
 /*
  * Partial completion handling for request-based dm
  */
-static void end_clone_bio(struct bio *clone, int error)
+static void end_clone_bio(struct bio *clone, int error,
+                         struct batch_complete *batch)
 {
        struct dm_rq_clone_bio_info *info = clone->bi_private;
        struct dm_rq_target_io *tio = info->tio;
index 3193aefe982b7b42badf4eba4adc36f89439d70c..ac8af5253fb674af3f3404a6fa11fd784aff5297 100644 (file)
@@ -70,7 +70,8 @@
 #include <linux/seq_file.h>
 
 
-static void faulty_fail(struct bio *bio, int error)
+static void faulty_fail(struct bio *bio, int error,
+                       struct batch_complete *batch)
 {
        struct bio *b = bio->bi_private;
 
index e2cb62ef5f5609a36e7fc5b2e2528c57a016ffb1..6f195a0696e7f582ed454d2896bb5081f70e6fa3 100644 (file)
@@ -379,7 +379,8 @@ EXPORT_SYMBOL(mddev_congested);
  * Generic flush handling for md
  */
 
-static void md_end_flush(struct bio *bio, int err)
+static void md_end_flush(struct bio *bio, int err,
+                        struct batch_complete *batch)
 {
        struct md_rdev *rdev = bio->bi_private;
        struct mddev *mddev = rdev->mddev;
@@ -756,7 +757,8 @@ void md_rdev_clear(struct md_rdev *rdev)
 }
 EXPORT_SYMBOL_GPL(md_rdev_clear);
 
-static void super_written(struct bio *bio, int error)
+static void super_written(struct bio *bio, int error,
+                         struct batch_complete *batch)
 {
        struct md_rdev *rdev = bio->bi_private;
        struct mddev *mddev = rdev->mddev;
@@ -807,7 +809,8 @@ void md_super_wait(struct mddev *mddev)
        finish_wait(&mddev->sb_wait, &wq);
 }
 
-static void bi_complete(struct bio *bio, int error)
+static void bi_complete(struct bio *bio, int error,
+                       struct batch_complete *batch)
 {
        complete((struct completion*)bio->bi_private);
 }
index 1642eae75a3335d1282a4bf53751802e1aeb52db..fecad70f53f645b02e5bf4e9502a3e65452df336 100644 (file)
@@ -83,7 +83,8 @@ static void multipath_end_bh_io (struct multipath_bh *mp_bh, int err)
        mempool_free(mp_bh, conf->pool);
 }
 
-static void multipath_end_request(struct bio *bio, int error)
+static void multipath_end_request(struct bio *bio, int error,
+                                 struct batch_complete *batch)
 {
        int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
        struct multipath_bh *mp_bh = bio->bi_private;
index aeb4e3f74791b3f1d163aa19c8f3ed34cfa0f284..619ba71cc6a536f546d051015bca0eaabed7f601 100644 (file)
@@ -294,7 +294,8 @@ static int find_bio_disk(struct r1bio *r1_bio, struct bio *bio)
        return mirror;
 }
 
-static void raid1_end_read_request(struct bio *bio, int error)
+static void raid1_end_read_request(struct bio *bio, int error,
+                                  struct batch_complete *batch)
 {
        int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
        struct r1bio *r1_bio = bio->bi_private;
@@ -379,7 +380,8 @@ static void r1_bio_write_done(struct r1bio *r1_bio)
        }
 }
 
-static void raid1_end_write_request(struct bio *bio, int error)
+static void raid1_end_write_request(struct bio *bio, int error,
+                                   struct batch_complete *batch)
 {
        int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
        struct r1bio *r1_bio = bio->bi_private;
@@ -1607,7 +1609,8 @@ abort:
 }
 
 
-static void end_sync_read(struct bio *bio, int error)
+static void end_sync_read(struct bio *bio, int error,
+                         struct batch_complete *batch)
 {
        struct r1bio *r1_bio = bio->bi_private;
 
@@ -1625,7 +1628,8 @@ static void end_sync_read(struct bio *bio, int error)
                reschedule_retry(r1_bio);
 }
 
-static void end_sync_write(struct bio *bio, int error)
+static void end_sync_write(struct bio *bio, int error,
+                          struct batch_complete *batch)
 {
        int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
        struct r1bio *r1_bio = bio->bi_private;
index fc5f60ce9f8c736027871d2ab92af9782ecdfe97..6005d9637ba7f8239d91ea4205dd33776ef61f92 100644 (file)
@@ -101,7 +101,8 @@ static int enough(struct r10conf *conf, int ignore);
 static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr,
                                int *skipped);
 static void reshape_request_write(struct mddev *mddev, struct r10bio *r10_bio);
-static void end_reshape_write(struct bio *bio, int error);
+static void end_reshape_write(struct bio *bio, int error,
+                             struct batch_complete *batch);
 static void end_reshape(struct r10conf *conf);
 
 static void * r10bio_pool_alloc(gfp_t gfp_flags, void *data)
@@ -358,7 +359,8 @@ static int find_bio_disk(struct r10conf *conf, struct r10bio *r10_bio,
        return r10_bio->devs[slot].devnum;
 }
 
-static void raid10_end_read_request(struct bio *bio, int error)
+static void raid10_end_read_request(struct bio *bio, int error,
+                                   struct batch_complete *batch)
 {
        int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
        struct r10bio *r10_bio = bio->bi_private;
@@ -441,7 +443,8 @@ static void one_write_done(struct r10bio *r10_bio)
        }
 }
 
-static void raid10_end_write_request(struct bio *bio, int error)
+static void raid10_end_write_request(struct bio *bio, int error,
+                                    struct batch_complete *batch)
 {
        int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
        struct r10bio *r10_bio = bio->bi_private;
@@ -1907,7 +1910,8 @@ abort:
 }
 
 
-static void end_sync_read(struct bio *bio, int error)
+static void end_sync_read(struct bio *bio, int error,
+                         struct batch_complete *batch)
 {
        struct r10bio *r10_bio = bio->bi_private;
        struct r10conf *conf = r10_bio->mddev->private;
@@ -1968,7 +1972,8 @@ static void end_sync_request(struct r10bio *r10_bio)
        }
 }
 
-static void end_sync_write(struct bio *bio, int error)
+static void end_sync_write(struct bio *bio, int error,
+                          struct batch_complete *batch)
 {
        int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
        struct r10bio *r10_bio = bio->bi_private;
@@ -4592,7 +4597,8 @@ static int handle_reshape_read_error(struct mddev *mddev,
        return 0;
 }
 
-static void end_reshape_write(struct bio *bio, int error)
+static void end_reshape_write(struct bio *bio, int error,
+                             struct batch_complete *batch)
 {
        int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
        struct r10bio *r10_bio = bio->bi_private;
index b2a460f14f492f2c2408b08b6963ad0357129fb7..7b6f5c028a06ea042619747624e2cb40c45a0cee 100644 (file)
@@ -556,9 +556,11 @@ static int use_new_offset(struct r5conf *conf, struct stripe_head *sh)
 }
 
 static void
-raid5_end_read_request(struct bio *bi, int error);
+raid5_end_read_request(struct bio *bi, int error,
+                      struct batch_complete *batch);
 static void
-raid5_end_write_request(struct bio *bi, int error);
+raid5_end_write_request(struct bio *bi, int error,
+                       struct batch_complete *batch);
 
 static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s)
 {
@@ -1737,7 +1739,8 @@ static void shrink_stripes(struct r5conf *conf)
        conf->slab_cache = NULL;
 }
 
-static void raid5_end_read_request(struct bio * bi, int error)
+static void raid5_end_read_request(struct bio * bi, int error,
+                                  struct batch_complete *batch)
 {
        struct stripe_head *sh = bi->bi_private;
        struct r5conf *conf = sh->raid_conf;
@@ -1857,7 +1860,8 @@ static void raid5_end_read_request(struct bio * bi, int error)
        release_stripe(sh);
 }
 
-static void raid5_end_write_request(struct bio *bi, int error)
+static void raid5_end_write_request(struct bio *bi, int error,
+                                   struct batch_complete *batch)
 {
        struct stripe_head *sh = bi->bi_private;
        struct r5conf *conf = sh->raid_conf;
@@ -3935,7 +3939,8 @@ static struct bio *remove_bio_from_retry(struct r5conf *conf)
  *  first).
  *  If the read failed..
  */
-static void raid5_align_endio(struct bio *bi, int error)
+static void raid5_align_endio(struct bio *bi, int error,
+                             struct batch_complete *batch)
 {
        struct bio* raid_bi  = bi->bi_private;
        struct mddev *mddev;
index 8bcc514ec8b6212e1f9b1913977d29e48ba5c24f..c2e5ca9b83033ee2ee19f39341cc2a264c1c7e83 100644 (file)
@@ -271,7 +271,8 @@ static void iblock_complete_cmd(struct se_cmd *cmd)
        kfree(ibr);
 }
 
-static void iblock_bio_done(struct bio *bio, int err)
+static void iblock_bio_done(struct bio *bio, int err,
+                           struct batch_complete *batch)
 {
        struct se_cmd *cmd = bio->bi_private;
        struct iblock_req *ibr = cmd->priv;
@@ -335,7 +336,8 @@ static void iblock_submit_bios(struct bio_list *list, int rw)
        blk_finish_plug(&plug);
 }
 
-static void iblock_end_io_flush(struct bio *bio, int err)
+static void iblock_end_io_flush(struct bio *bio, int err,
+                               struct batch_complete *batch)
 {
        struct se_cmd *cmd = bio->bi_private;
 
index e992b27aa0904b75320991b0adbb65b3d84037b6..1e98731798606e0ba65cee012af958b5b2ecf9c4 100644 (file)
@@ -835,7 +835,8 @@ static ssize_t pscsi_show_configfs_dev_params(struct se_device *dev, char *b)
        return bl;
 }
 
-static void pscsi_bi_endio(struct bio *bio, int error)
+static void pscsi_bi_endio(struct bio *bio, int error,
+                          struct batch_complete *batch)
 {
        bio_put(bio);
 }
index 8fb42916d8a29812e349fdbfa980ef1c34056ce4..69f6f802b09ec9d6478c4261fb7b88c639432ee8 100644 (file)
@@ -510,7 +510,8 @@ static void bio_integrity_verify_fn(struct work_struct *work)
  * in process context. This function postpones completion
  * accordingly.
  */
-void bio_integrity_endio(struct bio *bio, int error)
+void bio_integrity_endio(struct bio *bio, int error,
+                        struct batch_complete *batch)
 {
        struct bio_integrity_payload *bip = bio->bi_integrity;
 
index 9238a54b562c9bb0b672f4bd6359871e192c21d8..9a0f31ffb389c2ea47a0982620ec46018272885c 100644 (file)
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -1413,7 +1413,8 @@ void bio_unmap_user(struct bio *bio)
 }
 EXPORT_SYMBOL(bio_unmap_user);
 
-static void bio_map_kern_endio(struct bio *bio, int err)
+static void bio_map_kern_endio(struct bio *bio, int err,
+                              struct batch_complete *batch)
 {
        bio_put(bio);
 }
@@ -1485,7 +1486,8 @@ struct bio *bio_map_kern(struct request_queue *q, void *data, unsigned int len,
 }
 EXPORT_SYMBOL(bio_map_kern);
 
-static void bio_copy_kern_endio(struct bio *bio, int err)
+static void bio_copy_kern_endio(struct bio *bio, int err,
+                               struct batch_complete *batch)
 {
        struct bio_vec *bvec;
        const int read = bio_data_dir(bio) == READ;
@@ -1708,7 +1710,7 @@ void bio_endio(struct bio *bio, int error)
        trace_block_bio_complete(bio, error);
 
        if (bio->bi_end_io)
-               bio->bi_end_io(bio, error);
+               bio->bi_end_io(bio, error, NULL);
 }
 EXPORT_SYMBOL(bio_endio);
 
@@ -1723,7 +1725,8 @@ void bio_pair_release(struct bio_pair *bp)
 }
 EXPORT_SYMBOL(bio_pair_release);
 
-static void bio_pair_end_1(struct bio *bi, int err)
+static void bio_pair_end_1(struct bio *bi, int err,
+                          struct batch_complete *batch)
 {
        struct bio_pair *bp = container_of(bi, struct bio_pair, bio1);
 
@@ -1733,7 +1736,8 @@ static void bio_pair_end_1(struct bio *bi, int err)
        bio_pair_release(bp);
 }
 
-static void bio_pair_end_2(struct bio *bi, int err)
+static void bio_pair_end_2(struct bio *bi, int err,
+                          struct batch_complete *batch)
 {
        struct bio_pair *bp = container_of(bi, struct bio_pair, bio2);
 
index 18af6f48781a1f31e1d41c23bb08a2e1b6ea12a7..3c617b3244c0ebe17037d19c3d7954b79b7acfef 100644 (file)
@@ -323,7 +323,8 @@ static void btrfsic_release_block_ctx(struct btrfsic_block_data_ctx *block_ctx);
 static int btrfsic_read_block(struct btrfsic_state *state,
                              struct btrfsic_block_data_ctx *block_ctx);
 static void btrfsic_dump_database(struct btrfsic_state *state);
-static void btrfsic_complete_bio_end_io(struct bio *bio, int err);
+static void btrfsic_complete_bio_end_io(struct bio *bio, int err,
+                                       struct batch_complete *batch);
 static int btrfsic_test_for_metadata(struct btrfsic_state *state,
                                     char **datav, unsigned int num_pages);
 static void btrfsic_process_written_block(struct btrfsic_dev_state *dev_state,
@@ -336,7 +337,8 @@ static int btrfsic_process_written_superblock(
                struct btrfsic_state *state,
                struct btrfsic_block *const block,
                struct btrfs_super_block *const super_hdr);
-static void btrfsic_bio_end_io(struct bio *bp, int bio_error_status);
+static void btrfsic_bio_end_io(struct bio *bp, int bio_error_status,
+                              struct batch_complete *batch);
 static void btrfsic_bh_end_io(struct buffer_head *bh, int uptodate);
 static int btrfsic_is_block_ref_by_superblock(const struct btrfsic_state *state,
                                              const struct btrfsic_block *block,
@@ -1751,7 +1753,8 @@ static int btrfsic_read_block(struct btrfsic_state *state,
        return block_ctx->len;
 }
 
-static void btrfsic_complete_bio_end_io(struct bio *bio, int err)
+static void btrfsic_complete_bio_end_io(struct bio *bio, int err,
+                                       struct batch_complete *batch)
 {
        complete((struct completion *)bio->bi_private);
 }
@@ -2294,7 +2297,8 @@ continue_loop:
        goto again;
 }
 
-static void btrfsic_bio_end_io(struct bio *bp, int bio_error_status)
+static void btrfsic_bio_end_io(struct bio *bp, int bio_error_status,
+                              struct batch_complete *batch)
 {
        struct btrfsic_block *block = (struct btrfsic_block *)bp->bi_private;
        int iodone_w_error;
@@ -2342,7 +2346,7 @@ static void btrfsic_bio_end_io(struct bio *bp, int bio_error_status)
                block = next_block;
        } while (NULL != block);
 
-       bp->bi_end_io(bp, bio_error_status);
+       bp->bi_end_io(bp, bio_error_status, batch);
 }
 
 static void btrfsic_bh_end_io(struct buffer_head *bh, int uptodate)
index 15b94089abc44cab2f9987d22a61cc81c7a5aa8f..74ae115edba088484f1e748dd54179eb12d05d6d 100644 (file)
@@ -153,7 +153,8 @@ fail:
  * The compressed pages are freed here, and it must be run
  * in process context
  */
-static void end_compressed_bio_read(struct bio *bio, int err)
+static void end_compressed_bio_read(struct bio *bio, int err,
+                                   struct batch_complete *batch)
 {
        struct compressed_bio *cb = bio->bi_private;
        struct inode *inode;
@@ -263,7 +264,8 @@ static noinline void end_compressed_writeback(struct inode *inode, u64 start,
  * This also calls the writeback end hooks for the file pages so that
  * metadata and checksums can be updated in the file.
  */
-static void end_compressed_bio_write(struct bio *bio, int err)
+static void end_compressed_bio_write(struct bio *bio, int err,
+                                    struct batch_complete *batch)
 {
        struct extent_io_tree *tree;
        struct compressed_bio *cb = bio->bi_private;
index 7d84651e850b22cb937b29c68d34c1119af1e4a0..46eaa856cda73c17881609bbb3917d4250709d06 100644 (file)
@@ -669,7 +669,8 @@ static int btree_io_failed_hook(struct page *page, int failed_mirror)
        return -EIO;    /* we fixed nothing */
 }
 
-static void end_workqueue_bio(struct bio *bio, int err)
+static void end_workqueue_bio(struct bio *bio, int err,
+                             struct batch_complete *batch)
 {
        struct end_io_wq *end_io_wq = bio->bi_private;
        struct btrfs_fs_info *fs_info;
@@ -2951,7 +2952,8 @@ static int write_dev_supers(struct btrfs_device *device,
  * endio for the write_dev_flush, this will wake anyone waiting
  * for the barrier when it is done
  */
-static void btrfs_end_empty_barrier(struct bio *bio, int err)
+static void btrfs_end_empty_barrier(struct bio *bio, int err,
+                                   struct batch_complete *batch)
 {
        if (err) {
                if (err == -EOPNOTSUPP)
index bed072aa461f3089903987382de616bb143f43ef..34bc7e27ac4fd068c667968abdf11e77b97eedaa 100644 (file)
@@ -1904,7 +1904,8 @@ static int free_io_failure(struct inode *inode, struct io_failure_record *rec,
        return err;
 }
 
-static void repair_io_failure_callback(struct bio *bio, int err)
+static void repair_io_failure_callback(struct bio *bio, int err,
+                                      struct batch_complete *batch)
 {
        complete(bio->bi_private);
 }
@@ -2284,7 +2285,8 @@ int end_extent_writepage(struct page *page, int err, u64 start, u64 end)
  * Scheduling is not allowed, so the extent state tree is expected
  * to have one and only one object corresponding to this IO.
  */
-static void end_bio_extent_writepage(struct bio *bio, int err)
+static void end_bio_extent_writepage(struct bio *bio, int err,
+                                    struct batch_complete *batch)
 {
        struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1;
        struct extent_io_tree *tree;
@@ -2330,7 +2332,8 @@ static void end_bio_extent_writepage(struct bio *bio, int err)
  * Scheduling is not allowed, so the extent state tree is expected
  * to have one and only one object corresponding to this IO.
  */
-static void end_bio_extent_readpage(struct bio *bio, int err)
+static void end_bio_extent_readpage(struct bio *bio, int err,
+                                   struct batch_complete *batch)
 {
        int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
        struct bio_vec *bvec_end = bio->bi_io_vec + bio->bi_vcnt - 1;
@@ -3153,7 +3156,8 @@ static void end_extent_buffer_writeback(struct extent_buffer *eb)
        wake_up_bit(&eb->bflags, EXTENT_BUFFER_WRITEBACK);
 }
 
-static void end_bio_extent_buffer_writepage(struct bio *bio, int err)
+static void end_bio_extent_buffer_writepage(struct bio *bio, int err,
+                                           struct batch_complete *batch)
 {
        int uptodate = err == 0;
        struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1;
index ca26188ff6293883189c7d25505a10fd576ef944..436d022fbe40a5d3babb73aeddb31b27ff631962 100644 (file)
@@ -6900,7 +6900,8 @@ struct btrfs_dio_private {
        struct bio *orig_bio;
 };
 
-static void btrfs_endio_direct_read(struct bio *bio, int err)
+static void btrfs_endio_direct_read(struct bio *bio, int err,
+                                   struct batch_complete *batch)
 {
        struct btrfs_dio_private *dip = bio->bi_private;
        struct bio_vec *bvec_end = bio->bi_io_vec + bio->bi_vcnt - 1;
@@ -6954,10 +6955,11 @@ failed:
        /* If we had a csum failure make sure to clear the uptodate flag */
        if (err)
                clear_bit(BIO_UPTODATE, &bio->bi_flags);
-       dio_end_io(bio, err);
+       dio_end_io(bio, err, batch);
 }
 
-static void btrfs_endio_direct_write(struct bio *bio, int err)
+static void btrfs_endio_direct_write(struct bio *bio, int err,
+                                    struct batch_complete *batch)
 {
        struct btrfs_dio_private *dip = bio->bi_private;
        struct inode *inode = dip->inode;
@@ -6999,7 +7001,7 @@ out_done:
        /* If we had an error make sure to clear the uptodate flag */
        if (err)
                clear_bit(BIO_UPTODATE, &bio->bi_flags);
-       dio_end_io(bio, err);
+       dio_end_io(bio, err, batch);
 }
 
 static int __btrfs_submit_bio_start_direct_io(struct inode *inode, int rw,
@@ -7013,7 +7015,8 @@ static int __btrfs_submit_bio_start_direct_io(struct inode *inode, int rw,
        return 0;
 }
 
-static void btrfs_end_dio_bio(struct bio *bio, int err)
+static void btrfs_end_dio_bio(struct bio *bio, int err,
+                             struct batch_complete *batch)
 {
        struct btrfs_dio_private *dip = bio->bi_private;
 
index 53c3501fa4ca348f13cb17617b363643a59b1f6f..239d397eb4dd48ea275f93edefebb439131b1fc7 100644 (file)
@@ -200,7 +200,8 @@ static void scrub_recheck_block_checksum(struct btrfs_fs_info *fs_info,
                                         int is_metadata, int have_csum,
                                         const u8 *csum, u64 generation,
                                         u16 csum_size);
-static void scrub_complete_bio_end_io(struct bio *bio, int err);
+static void scrub_complete_bio_end_io(struct bio *bio, int err,
+                                     struct batch_complete *batch);
 static int scrub_repair_block_from_good_copy(struct scrub_block *sblock_bad,
                                             struct scrub_block *sblock_good,
                                             int force_write);
@@ -223,7 +224,8 @@ static int scrub_pages(struct scrub_ctx *sctx, u64 logical, u64 len,
                       u64 physical, struct btrfs_device *dev, u64 flags,
                       u64 gen, int mirror_num, u8 *csum, int force,
                       u64 physical_for_dev_replace);
-static void scrub_bio_end_io(struct bio *bio, int err);
+static void scrub_bio_end_io(struct bio *bio, int err,
+                            struct batch_complete *batch);
 static void scrub_bio_end_io_worker(struct btrfs_work *work);
 static void scrub_block_complete(struct scrub_block *sblock);
 static void scrub_remap_extent(struct btrfs_fs_info *fs_info,
@@ -240,7 +242,8 @@ static void scrub_free_wr_ctx(struct scrub_wr_ctx *wr_ctx);
 static int scrub_add_page_to_wr_bio(struct scrub_ctx *sctx,
                                    struct scrub_page *spage);
 static void scrub_wr_submit(struct scrub_ctx *sctx);
-static void scrub_wr_bio_end_io(struct bio *bio, int err);
+static void scrub_wr_bio_end_io(struct bio *bio, int err,
+                               struct batch_complete *batch);
 static void scrub_wr_bio_end_io_worker(struct btrfs_work *work);
 static int write_page_nocow(struct scrub_ctx *sctx,
                            u64 physical_for_dev_replace, struct page *page);
@@ -1385,7 +1388,8 @@ static void scrub_recheck_block_checksum(struct btrfs_fs_info *fs_info,
                sblock->checksum_error = 1;
 }
 
-static void scrub_complete_bio_end_io(struct bio *bio, int err)
+static void scrub_complete_bio_end_io(struct bio *bio, int err,
+                                     struct batch_complete *batch)
 {
        complete((struct completion *)bio->bi_private);
 }
@@ -1585,7 +1589,8 @@ static void scrub_wr_submit(struct scrub_ctx *sctx)
        btrfsic_submit_bio(WRITE, sbio->bio);
 }
 
-static void scrub_wr_bio_end_io(struct bio *bio, int err)
+static void scrub_wr_bio_end_io(struct bio *bio, int err,
+                               struct batch_complete *batch)
 {
        struct scrub_bio *sbio = bio->bi_private;
        struct btrfs_fs_info *fs_info = sbio->dev->dev_root->fs_info;
@@ -2055,7 +2060,8 @@ leave_nomem:
        return 0;
 }
 
-static void scrub_bio_end_io(struct bio *bio, int err)
+static void scrub_bio_end_io(struct bio *bio, int err,
+                            struct batch_complete *batch)
 {
        struct scrub_bio *sbio = bio->bi_private;
        struct btrfs_fs_info *fs_info = sbio->dev->dev_root->fs_info;
index d90e0485e01b0442d523f86c3f527f79f00393e3..8fb5d4591c49897e781604797135d1f3c4c252e6 100644 (file)
@@ -5018,7 +5018,7 @@ static unsigned int extract_stripe_index_from_bio_private(void *bi_private)
        return (unsigned int)((uintptr_t)bi_private) & 3;
 }
 
-static void btrfs_end_bio(struct bio *bio, int err)
+static void btrfs_end_bio(struct bio *bio, int err, struct batch_complete *batch)
 {
        struct btrfs_bio *bbio = extract_bbio_from_bio_private(bio->bi_private);
        int is_orig_bio = 0;
@@ -5075,7 +5075,7 @@ static void btrfs_end_bio(struct bio *bio, int err)
                }
                kfree(bbio);
 
-               bio_endio(bio, err);
+               bio_endio_batch(bio, err, batch);
        } else if (!is_orig_bio) {
                bio_put(bio);
        }
index 328a9312c6511ebd16e1bb20c34ca77e7ddd9297..b22d0bba073706dd9b5aba473178cfc5bfd85dba 100644 (file)
@@ -2884,7 +2884,8 @@ sector_t generic_block_bmap(struct address_space *mapping, sector_t block,
 }
 EXPORT_SYMBOL(generic_block_bmap);
 
-static void end_bio_bh_io_sync(struct bio *bio, int err)
+static void end_bio_bh_io_sync(struct bio *bio, int err,
+                              struct batch_complete *batch)
 {
        struct buffer_head *bh = bio->bi_private;
 
index af02dd877887d3bbac19da8178055252762e2a55..5e2a62beee4348a6cce784aa218ac3527cb63fd5 100644 (file)
@@ -324,12 +324,12 @@ static void dio_bio_end_io(struct bio *bio, int error)
  * so that the DIO specific endio actions are dealt with after the filesystem
  * has done it's completion work.
  */
-void dio_end_io(struct bio *bio, int error)
+void dio_end_io(struct bio *bio, int error, struct batch_complete *batch)
 {
        struct dio *dio = bio->bi_private;
 
        if (dio->is_async)
-               dio_bio_end_aio(bio, error);
+               dio_bio_end_aio(bio, error, batch);
        else
                dio_bio_end_io(bio, error);
 }
@@ -350,10 +350,7 @@ dio_bio_alloc(struct dio *dio, struct dio_submit *sdio,
 
        bio->bi_bdev = bdev;
        bio->bi_sector = first_sector;
-       if (dio->is_async)
-               bio->bi_end_io = dio_bio_end_aio;
-       else
-               bio->bi_end_io = dio_bio_end_io;
+       bio->bi_end_io = dio_end_io;
 
        sdio->bio = bio;
        sdio->logical_offset_in_bio = sdio->cur_page_fs_offset;
index f6ae3164fce181557bf9f99e6411c50fb9b635f2..a9afb18883a3267bdb9d5df7cbca4a58991f76cd 100644 (file)
@@ -239,7 +239,8 @@ static void buffer_io_error(struct buffer_head *bh)
                        (unsigned long long)bh->b_blocknr);
 }
 
-static void ext4_end_bio(struct bio *bio, int error)
+static void ext4_end_bio(struct bio *bio, int error,
+                        struct batch_complete *batch)
 {
        ext4_io_end_t *io_end = bio->bi_private;
        struct inode *inode;
index 42c8410ae30bf8fb343c3d82db5de6d71fe21543..2daf2b8a58710b85a1dbf8ca9a232bad2c83135b 100644 (file)
@@ -313,7 +313,7 @@ struct page *get_new_data_page(struct inode *inode, pgoff_t index,
        return page;
 }
 
-static void read_end_io(struct bio *bio, int err)
+static void read_end_io(struct bio *bio, int err, struct batch_complete *batch)
 {
        const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
        struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1;
index 777f17e496e606de7f7e02103e606e291521b1f2..9a3ae8d92738f9a5165452be885b2256096336f0 100644 (file)
@@ -601,7 +601,8 @@ static const struct segment_allocation default_salloc_ops = {
        .allocate_segment = allocate_segment_by_default,
 };
 
-static void f2fs_end_io_write(struct bio *bio, int err)
+static void f2fs_end_io_write(struct bio *bio, int err,
+                             struct batch_complete *batch)
 {
        const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
        struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1;
index 5c37ef982390eb361684ba796776edbb64938c97..562adf31962f277c848cde9977574dcceeb0a168 100644 (file)
@@ -200,7 +200,8 @@ static void gfs2_end_log_write_bh(struct gfs2_sbd *sdp, struct bio_vec *bvec,
  *
  */
 
-static void gfs2_end_log_write(struct bio *bio, int error)
+static void gfs2_end_log_write(struct bio *bio, int error,
+                              struct batch_complete *batch)
 {
        struct gfs2_sbd *sdp = bio->bi_private;
        struct bio_vec *bvec;
index 60ede2a0f43fbc498201cc3262da939110eac0bb..86eb657aeaca2bed7771d5282913e25ca4af32fa 100644 (file)
@@ -155,7 +155,8 @@ static int gfs2_check_sb(struct gfs2_sbd *sdp, int silent)
        return -EINVAL;
 }
 
-static void end_bio_io_page(struct bio *bio, int error)
+static void end_bio_io_page(struct bio *bio, int error,
+                           struct batch_complete *batch)
 {
        struct page *page = bio->bi_private;
 
index 90effcccca9af4c13f6b44b7b3fe756612f9d735..2e7ffba54507db21e0675348ac39e5e5d244e705 100644 (file)
@@ -24,7 +24,8 @@ struct hfsplus_wd {
        u16 embed_count;
 };
 
-static void hfsplus_end_io_sync(struct bio *bio, int err)
+static void hfsplus_end_io_sync(struct bio *bio, int err,
+                               struct batch_complete *batch)
 {
        if (err)
                clear_bit(BIO_UPTODATE, &bio->bi_flags);
index 8ae5e350da430132ca37c94ff8e22d6053b76877..e641f6e74ffccfda2342b6c3dcd1a59e512c7d0f 100644 (file)
@@ -2152,7 +2152,7 @@ static void lbmStartIO(struct lbuf * bp)
        /* check if journaling to disk has been disabled */
        if (log->no_integrity) {
                bio->bi_size = 0;
-               lbmIODone(bio, 0);
+               lbmIODone(bio, 0, NULL);
        } else {
                submit_bio(WRITE_SYNC, bio);
                INCREMENT(lmStat.submitted);
@@ -2190,7 +2190,7 @@ static int lbmIOWait(struct lbuf * bp, int flag)
  *
  * executed at INTIODONE level
  */
-static void lbmIODone(struct bio *bio, int error)
+static void lbmIODone(struct bio *bio, int error, struct batch_complete *batch)
 {
        struct lbuf *bp = bio->bi_private;
        struct lbuf *nextbp, *tail;
index 6740d34cd82b802e948b8760fcf13954a8a12ad2..6ba675782e9f64f844625515f8a77dbf960358c0 100644 (file)
@@ -283,7 +283,8 @@ static void last_read_complete(struct page *page)
        unlock_page(page);
 }
 
-static void metapage_read_end_io(struct bio *bio, int err)
+static void metapage_read_end_io(struct bio *bio, int err,
+                                struct batch_complete *batch)
 {
        struct page *page = bio->bi_private;
 
@@ -338,7 +339,8 @@ static void last_write_complete(struct page *page)
        end_page_writeback(page);
 }
 
-static void metapage_write_end_io(struct bio *bio, int err)
+static void metapage_write_end_io(struct bio *bio, int err,
+                                 struct batch_complete *batch)
 {
        struct page *page = bio->bi_private;
 
index 550475ca6a0e0ec35c82d90b10372f2e4434fe90..0ae2254f74bf21f89787b9372295f41a0501c971 100644 (file)
@@ -14,7 +14,8 @@
 
 #define PAGE_OFS(ofs) ((ofs) & (PAGE_SIZE-1))
 
-static void request_complete(struct bio *bio, int err)
+static void request_complete(struct bio *bio, int err,
+                            struct batch_complete *batch)
 {
        complete((struct completion *)bio->bi_private);
 }
@@ -64,7 +65,8 @@ static int bdev_readpage(void *_sb, struct page *page)
 
 static DECLARE_WAIT_QUEUE_HEAD(wq);
 
-static void writeseg_end_io(struct bio *bio, int err)
+static void writeseg_end_io(struct bio *bio, int err,
+                           struct batch_complete *batch)
 {
        const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
        struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1;
@@ -168,7 +170,7 @@ static void bdev_writeseg(struct super_block *sb, u64 ofs, size_t len)
 }
 
 
-static void erase_end_io(struct bio *bio, int err
+static void erase_end_io(struct bio *bio, int err, struct batch_complete *batch)
 { 
        const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); 
        struct super_block *sb = bio->bi_private; 
index 0face1c4d4c6bd4ea33cb60e45b8c7fad8235acf..a4089bbfee0a294356d86035d012f5a8c219a0ad 100644 (file)
@@ -41,7 +41,7 @@
  * status of that page is hard.  See end_buffer_async_read() for the details.
  * There is no point in duplicating all that complexity.
  */
-static void mpage_end_io(struct bio *bio, int err)
+static void mpage_end_io(struct bio *bio, int err, struct batch_complete *batch)
 {
        const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
        struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1;
index 434b93ec0970b80ac221fcf78e92087da75c3f42..76cf6955705123822e330fd142ec4cc712782ff6 100644 (file)
@@ -143,7 +143,7 @@ bl_submit_bio(int rw, struct bio *bio)
 
 static struct bio *bl_alloc_init_bio(int npg, sector_t isect,
                                     struct pnfs_block_extent *be,
-                                    void (*end_io)(struct bio *, int err),
+                                    bio_end_io_t *end_io,
                                     struct parallel_io *par)
 {
        struct bio *bio;
@@ -167,7 +167,7 @@ static struct bio *bl_alloc_init_bio(int npg, sector_t isect,
 static struct bio *do_add_page_to_bio(struct bio *bio, int npg, int rw,
                                      sector_t isect, struct page *page,
                                      struct pnfs_block_extent *be,
-                                     void (*end_io)(struct bio *, int err),
+                                     bio_end_io_t *end_io,
                                      struct parallel_io *par,
                                      unsigned int offset, int len)
 {
@@ -190,7 +190,7 @@ retry:
 static struct bio *bl_add_page_to_bio(struct bio *bio, int npg, int rw,
                                      sector_t isect, struct page *page,
                                      struct pnfs_block_extent *be,
-                                     void (*end_io)(struct bio *, int err),
+                                     bio_end_io_t *end_io,
                                      struct parallel_io *par)
 {
        return do_add_page_to_bio(bio, npg, rw, isect, page, be,
@@ -198,7 +198,8 @@ static struct bio *bl_add_page_to_bio(struct bio *bio, int npg, int rw,
 }
 
 /* This is basically copied from mpage_end_io_read */
-static void bl_end_io_read(struct bio *bio, int err)
+static void bl_end_io_read(struct bio *bio, int err,
+                          struct batch_complete *batch)
 {
        struct parallel_io *par = bio->bi_private;
        const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
@@ -380,7 +381,8 @@ static void mark_extents_written(struct pnfs_block_layout *bl,
        }
 }
 
-static void bl_end_io_write_zero(struct bio *bio, int err)
+static void bl_end_io_write_zero(struct bio *bio, int err,
+                                struct batch_complete *batch)
 {
        struct parallel_io *par = bio->bi_private;
        const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
@@ -408,7 +410,8 @@ static void bl_end_io_write_zero(struct bio *bio, int err)
        put_parallel(par);
 }
 
-static void bl_end_io_write(struct bio *bio, int err)
+static void bl_end_io_write(struct bio *bio, int err,
+                           struct batch_complete *batch)
 {
        struct parallel_io *par = bio->bi_private;
        const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
@@ -487,7 +490,7 @@ map_block(struct buffer_head *bh, sector_t isect, struct pnfs_block_extent *be)
 }
 
 static void
-bl_read_single_end_io(struct bio *bio, int error)
+bl_read_single_end_io(struct bio *bio, int error, struct batch_complete *batch)
 {
        struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1;
        struct page *page = bvec->bv_page;
index dc9a913784ab94127fba6e4503d12a0708069f41..680b65b8a74d6935224e4b27f767124ee2dc95b8 100644 (file)
@@ -338,7 +338,8 @@ void nilfs_add_checksums_on_logs(struct list_head *logs, u32 seed)
 /*
  * BIO operations
  */
-static void nilfs_end_bio_write(struct bio *bio, int err)
+static void nilfs_end_bio_write(struct bio *bio, int err,
+                               struct batch_complete *batch)
 {
        const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
        struct nilfs_segment_buffer *segbuf = bio->bi_private;
index 8c3318bf2252e8000a7e12ffd889ddeb42e6a222..0cc19d0417bf60865a9878aee401ea240dd473d7 100644 (file)
@@ -372,8 +372,8 @@ static void o2hb_wait_on_io(struct o2hb_region *reg,
        wait_for_completion(&wc->wc_io_complete);
 }
 
-static void o2hb_bio_end_io(struct bio *bio,
-                          int error)
+static void o2hb_bio_end_io(struct bio *bio, int error,
+                           struct batch_complete *batch)
 {
        struct o2hb_bio_wait_ctxt *wc = bio->bi_private;
 
index 2b2691b7342890e64e957d616dfb1c4aa2efc8c1..f64ee713050927b24336ab067789ee1e2572155f 100644 (file)
@@ -380,7 +380,8 @@ xfs_imap_valid(
 STATIC void
 xfs_end_bio(
        struct bio              *bio,
-       int                     error)
+       int                     error,
+       struct batch_complete *batch)
 {
        xfs_ioend_t             *ioend = bio->bi_private;
 
index 82b70bda9f47a51eb3f31a50ae4fcd32f6c57047..cee0e42b53896813e64b42d2ecb1bcbf71507db9 100644 (file)
@@ -1224,7 +1224,8 @@ _xfs_buf_ioend(
 STATIC void
 xfs_buf_bio_end_io(
        struct bio              *bio,
-       int                     error)
+       int                     error,
+       struct batch_complete *batch)
 {
        xfs_buf_t               *bp = (xfs_buf_t *)bio->bi_private;
 
index ef24466d8f82516a76029577df9c8f1ec530cf20..7f3089ffc87a72a38703f474414b7c0ab15e16b0 100644 (file)
@@ -580,7 +580,7 @@ extern int bio_integrity_enabled(struct bio *bio);
 extern int bio_integrity_set_tag(struct bio *, void *, unsigned int);
 extern int bio_integrity_get_tag(struct bio *, void *, unsigned int);
 extern int bio_integrity_prep(struct bio *);
-extern void bio_integrity_endio(struct bio *, int);
+extern void bio_integrity_endio(struct bio *, int, struct batch_complete *);
 extern void bio_integrity_advance(struct bio *, unsigned int);
 extern void bio_integrity_trim(struct bio *, unsigned int, unsigned int);
 extern void bio_integrity_split(struct bio *, struct bio_pair *, int);
index fa1abeb45b7602a4f0c1a4098f05f63d7a075281..b3195e30880d34e7a27895e85535ab3da1ed51d6 100644 (file)
@@ -16,7 +16,8 @@ struct page;
 struct block_device;
 struct io_context;
 struct cgroup_subsys_state;
-typedef void (bio_end_io_t) (struct bio *, int);
+struct batch_complete;
+typedef void (bio_end_io_t) (struct bio *, int, struct batch_complete *);
 typedef void (bio_destructor_t) (struct bio *);
 
 /*
index 4c4f0e48831394a05eab2824cf76803b71975098..a63c106cce29843f85b6ec12b792fcefd930a908 100644 (file)
@@ -2447,7 +2447,7 @@ enum {
        DIO_SKIP_HOLES  = 0x02,
 };
 
-void dio_end_io(struct bio *bio, int error);
+void dio_end_io(struct bio *bio, int error, struct batch_complete *batch);
 
 ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
        struct block_device *bdev, const struct iovec *iov, loff_t offset,
index 2818a123f3eae377960e30d2411d9af1ba66b8a1..7429973fe091bc1efed78f0245a11e5f201131f7 100644 (file)
@@ -331,7 +331,8 @@ static inline void mem_cgroup_uncharge_swap(swp_entry_t ent)
 extern int swap_readpage(struct page *);
 extern int swap_writepage(struct page *page, struct writeback_control *wbc);
 extern int swap_set_page_dirty(struct page *page);
-extern void end_swap_bio_read(struct bio *bio, int err);
+extern void end_swap_bio_read(struct bio *bio, int err,
+                             struct batch_complete *batch);
 
 int add_swap_extent(struct swap_info_struct *sis, unsigned long start_page,
                unsigned long nr_pages, sector_t start_block);
index c9f0a4339a7dafc2ba7295e49ad8fcdda8fa13de..708c1e99f57bb914b04c797251d0c053e3a10d3d 100644 (file)
@@ -147,12 +147,14 @@ static void bounce_end_io(struct bio *bio, mempool_t *pool, int err)
        bio_put(bio);
 }
 
-static void bounce_end_io_write(struct bio *bio, int err)
+static void bounce_end_io_write(struct bio *bio, int err,
+                               struct batch_complete *batch)
 {
        bounce_end_io(bio, page_pool, err);
 }
 
-static void bounce_end_io_write_isa(struct bio *bio, int err)
+static void bounce_end_io_write_isa(struct bio *bio, int err,
+                                   struct batch_complete *batch)
 {
 
        bounce_end_io(bio, isa_page_pool, err);
@@ -168,12 +170,14 @@ static void __bounce_end_io_read(struct bio *bio, mempool_t *pool, int err)
        bounce_end_io(bio, pool, err);
 }
 
-static void bounce_end_io_read(struct bio *bio, int err)
+static void bounce_end_io_read(struct bio *bio, int err,
+                              struct batch_complete *batch)
 {
        __bounce_end_io_read(bio, page_pool, err);
 }
 
-static void bounce_end_io_read_isa(struct bio *bio, int err)
+static void bounce_end_io_read_isa(struct bio *bio, int err,
+                                  struct batch_complete *batch)
 {
        __bounce_end_io_read(bio, isa_page_pool, err);
 }
index c2a3744299145bd7663966405c5756d04588f138..7c559793614fff191b940455b30efb336103ac6a 100644 (file)
@@ -42,7 +42,8 @@ static struct bio *get_swap_bio(gfp_t gfp_flags,
        return bio;
 }
 
-static void end_swap_bio_write(struct bio *bio, int err)
+static void end_swap_bio_write(struct bio *bio, int err,
+                              struct batch_complete *batch)
 {
        const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
        struct page *page = bio->bi_io_vec[0].bv_page;
@@ -68,7 +69,7 @@ static void end_swap_bio_write(struct bio *bio, int err)
        bio_put(bio);
 }
 
-void end_swap_bio_read(struct bio *bio, int err)
+void end_swap_bio_read(struct bio *bio, int err, struct batch_complete *batch)
 {
        const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
        struct page *page = bio->bi_io_vec[0].bv_page;