blk: remove bio_set arg from blk_queue_split()
authorNeilBrown <neilb@suse.com>
Sun, 18 Jun 2017 04:38:57 +0000 (14:38 +1000)
committerJens Axboe <axboe@kernel.dk>
Sun, 18 Jun 2017 18:40:59 +0000 (12:40 -0600)
blk_queue_split() is always called with the last arg being q->bio_split,
where 'q' is the first arg.

Also blk_queue_split() sometimes uses the passed-in 'bs' and sometimes uses
q->bio_split.

This is inconsistent and unnecessary.  Remove the last arg and always use
q->bio_split inside blk_queue_split()

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Credit-to: Javier González <jg@lightnvm.io> (Noticed that lightnvm was missed)
Reviewed-by: Javier González <javier@cnexlabs.com>
Tested-by: Javier González <javier@cnexlabs.com>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
14 files changed:
block/blk-core.c
block/blk-merge.c
block/blk-mq.c
drivers/block/drbd/drbd_req.c
drivers/block/pktcdvd.c
drivers/block/ps3vram.c
drivers/block/rsxx/dev.c
drivers/block/umem.c
drivers/lightnvm/pblk-init.c
drivers/lightnvm/rrpc.c
drivers/md/md.c
drivers/s390/block/dcssblk.c
drivers/s390/block/xpram.c
include/linux/blkdev.h

index 8592409db2720a324fb256c05a84071188167912..31b5ece6b18e5455b0364a33759baec1263fe7be 100644 (file)
@@ -1723,7 +1723,7 @@ static blk_qc_t blk_queue_bio(struct request_queue *q, struct bio *bio)
         */
        blk_queue_bounce(q, &bio);
 
-       blk_queue_split(q, &bio, q->bio_split);
+       blk_queue_split(q, &bio);
 
        if (bio_integrity_enabled(bio) && bio_integrity_prep(bio)) {
                bio->bi_status = BLK_STS_IOERR;
index 3990ae40634123b4e16b0398ae36d1f1b74dc205..d59074556703be17376cadd35f234b1fdc484abd 100644 (file)
@@ -202,8 +202,7 @@ split:
        return do_split ? new : NULL;
 }
 
-void blk_queue_split(struct request_queue *q, struct bio **bio,
-                    struct bio_set *bs)
+void blk_queue_split(struct request_queue *q, struct bio **bio)
 {
        struct bio *split, *res;
        unsigned nsegs;
@@ -211,13 +210,13 @@ void blk_queue_split(struct request_queue *q, struct bio **bio,
        switch (bio_op(*bio)) {
        case REQ_OP_DISCARD:
        case REQ_OP_SECURE_ERASE:
-               split = blk_bio_discard_split(q, *bio, bs, &nsegs);
+               split = blk_bio_discard_split(q, *bio, q->bio_split, &nsegs);
                break;
        case REQ_OP_WRITE_ZEROES:
-               split = blk_bio_write_zeroes_split(q, *bio, bs, &nsegs);
+               split = blk_bio_write_zeroes_split(q, *bio, q->bio_split, &nsegs);
                break;
        case REQ_OP_WRITE_SAME:
-               split = blk_bio_write_same_split(q, *bio, bs, &nsegs);
+               split = blk_bio_write_same_split(q, *bio, q->bio_split, &nsegs);
                break;
        default:
                split = blk_bio_segment_split(q, *bio, q->bio_split, &nsegs);
index be40c1d6e3a402a1055672f044b682a48b5aead9..cc85de9d6b2d24fe316060d27b3b0c19da50e0c1 100644 (file)
@@ -1499,7 +1499,7 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio)
 
        blk_queue_bounce(q, &bio);
 
-       blk_queue_split(q, &bio, q->bio_split);
+       blk_queue_split(q, &bio);
 
        if (bio_integrity_enabled(bio) && bio_integrity_prep(bio)) {
                bio_io_error(bio);
index fca6b9914948b37ec6a28ab95e14204054692e6e..f6e865b2d543aa2bceafddf20954aa7b3c88883e 100644 (file)
@@ -1560,7 +1560,7 @@ blk_qc_t drbd_make_request(struct request_queue *q, struct bio *bio)
        struct drbd_device *device = (struct drbd_device *) q->queuedata;
        unsigned long start_jif;
 
-       blk_queue_split(q, &bio, q->bio_split);
+       blk_queue_split(q, &bio);
 
        start_jif = jiffies;
 
index e8a381161db69593e238f4c6f7e8af81678919cc..1f363638b45397d223bf204388d279a6e3090e67 100644 (file)
@@ -2414,7 +2414,7 @@ static blk_qc_t pkt_make_request(struct request_queue *q, struct bio *bio)
 
        blk_queue_bounce(q, &bio);
 
-       blk_queue_split(q, &bio, q->bio_split);
+       blk_queue_split(q, &bio);
 
        pd = q->queuedata;
        if (!pd) {
index 6fa2b8197013f9c8dfe8442f6c2ccd8d0d28d80b..e0e81cacd78173872f9d7e6d66478406ed239955 100644 (file)
@@ -606,7 +606,7 @@ static blk_qc_t ps3vram_make_request(struct request_queue *q, struct bio *bio)
 
        dev_dbg(&dev->core, "%s\n", __func__);
 
-       blk_queue_split(q, &bio, q->bio_split);
+       blk_queue_split(q, &bio);
 
        spin_lock_irq(&priv->lock);
        busy = !bio_list_empty(&priv->list);
index 0b0a0a9023554ccecc9ccd0b9ece9abafec5828c..4e8bdfa0aa317fcaa618f15b1de988a041e94c1b 100644 (file)
@@ -151,7 +151,7 @@ static blk_qc_t rsxx_make_request(struct request_queue *q, struct bio *bio)
        struct rsxx_bio_meta *bio_meta;
        blk_status_t st = BLK_STS_IOERR;
 
-       blk_queue_split(q, &bio, q->bio_split);
+       blk_queue_split(q, &bio);
 
        might_sleep();
 
index 4b3c947697b1f693aa0b389c2be413406eab2de8..0677d2514665c75c3c45c27b827b01d6f045fc07 100644 (file)
@@ -529,7 +529,7 @@ static blk_qc_t mm_make_request(struct request_queue *q, struct bio *bio)
                 (unsigned long long)bio->bi_iter.bi_sector,
                 bio->bi_iter.bi_size);
 
-       blk_queue_split(q, &bio, q->bio_split);
+       blk_queue_split(q, &bio);
 
        spin_lock_irq(&card->lock);
        *card->biotail = bio;
index ae8cd6d5af8b2998ec34fafe9a51d358ab6db552..b3fec8ec55b892eee6cd91a4e8ecdd4171907646 100644 (file)
@@ -33,7 +33,7 @@ static int pblk_rw_io(struct request_queue *q, struct pblk *pblk,
         * constraint. Writes can be of arbitrary size.
         */
        if (bio_data_dir(bio) == READ) {
-               blk_queue_split(q, &bio, q->bio_split);
+               blk_queue_split(q, &bio);
                ret = pblk_submit_read(pblk, bio);
                if (ret == NVM_IO_DONE && bio_flagged(bio, BIO_CLONED))
                        bio_put(bio);
@@ -46,7 +46,7 @@ static int pblk_rw_io(struct request_queue *q, struct pblk *pblk,
         * available for user I/O.
         */
        if (unlikely(pblk_get_secs(bio) >= pblk_rl_sysfs_rate_show(&pblk->rl)))
-               blk_queue_split(q, &bio, q->bio_split);
+               blk_queue_split(q, &bio);
 
        return pblk_write_to_cache(pblk, bio, PBLK_IOTYPE_USER);
 }
index 8d3b53bb3307e537f73016566dc517b925c3ca68..267f01ae87e447b6fba7e2fe47f39a1a926416f4 100644 (file)
@@ -994,7 +994,7 @@ static blk_qc_t rrpc_make_rq(struct request_queue *q, struct bio *bio)
        struct nvm_rq *rqd;
        int err;
 
-       blk_queue_split(q, &bio, q->bio_split);
+       blk_queue_split(q, &bio);
 
        if (bio_op(bio) == REQ_OP_DISCARD) {
                rrpc_discard(rrpc, bio);
index 6d493b54d56c4d68f74c46e0c7598694d00715f1..d43df1176c23090e2023fa0f0dc99b42b270b514 100644 (file)
@@ -265,7 +265,7 @@ static blk_qc_t md_make_request(struct request_queue *q, struct bio *bio)
        unsigned int sectors;
        int cpu;
 
-       blk_queue_split(q, &bio, q->bio_split);
+       blk_queue_split(q, &bio);
 
        if (mddev == NULL || mddev->pers == NULL) {
                bio_io_error(bio);
index 36e5280af3e442b5947881ad46b5a6faf61b0f10..06eb1de52d1c0a02a1649a6b62c419388087b713 100644 (file)
@@ -845,7 +845,7 @@ dcssblk_make_request(struct request_queue *q, struct bio *bio)
        unsigned long source_addr;
        unsigned long bytes_done;
 
-       blk_queue_split(q, &bio, q->bio_split);
+       blk_queue_split(q, &bio);
 
        bytes_done = 0;
        dev_info = bio->bi_bdev->bd_disk->private_data;
index b9d7e755c8a37890961d06f95c77052cbd74d92f..a48f0d40c1d253caf6d2d994307cd08a9e43de5c 100644 (file)
@@ -190,7 +190,7 @@ static blk_qc_t xpram_make_request(struct request_queue *q, struct bio *bio)
        unsigned long page_addr;
        unsigned long bytes;
 
-       blk_queue_split(q, &bio, q->bio_split);
+       blk_queue_split(q, &bio);
 
        if ((bio->bi_iter.bi_sector & 7) != 0 ||
            (bio->bi_iter.bi_size & 4095) != 0)
index 76b6df862a128db892fee315bb04dca852aafce3..670df402bc5184f6f8d60c147a0509955e99db9e 100644 (file)
@@ -944,8 +944,7 @@ extern blk_status_t blk_insert_cloned_request(struct request_queue *q,
                                     struct request *rq);
 extern int blk_rq_append_bio(struct request *rq, struct bio *bio);
 extern void blk_delay_queue(struct request_queue *, unsigned long);
-extern void blk_queue_split(struct request_queue *, struct bio **,
-                           struct bio_set *);
+extern void blk_queue_split(struct request_queue *, struct bio **);
 extern void blk_recount_segments(struct request_queue *, struct bio *);
 extern int scsi_verify_blk_ioctl(struct block_device *, unsigned int);
 extern int scsi_cmd_blk_ioctl(struct block_device *, fmode_t,