diff options
author | NeilBrown <neilb@suse.com> | 2017-06-18 00:38:57 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-06-18 14:40:59 -0400 |
commit | af67c31fba3b879b241536a48df703a2eee18ebf (patch) | |
tree | 60b9f32d39c955a79e552b00900e1a6ceb66532b | |
parent | e4cdf1a1cb161a648cc1ed7d6148fc3b99a1b3f5 (diff) |
blk: remove bio_set arg from blk_queue_split()
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>
-rw-r--r-- | block/blk-core.c | 2 | ||||
-rw-r--r-- | block/blk-merge.c | 9 | ||||
-rw-r--r-- | block/blk-mq.c | 2 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_req.c | 2 | ||||
-rw-r--r-- | drivers/block/pktcdvd.c | 2 | ||||
-rw-r--r-- | drivers/block/ps3vram.c | 2 | ||||
-rw-r--r-- | drivers/block/rsxx/dev.c | 2 | ||||
-rw-r--r-- | drivers/block/umem.c | 2 | ||||
-rw-r--r-- | drivers/lightnvm/pblk-init.c | 4 | ||||
-rw-r--r-- | drivers/lightnvm/rrpc.c | 2 | ||||
-rw-r--r-- | drivers/md/md.c | 2 | ||||
-rw-r--r-- | drivers/s390/block/dcssblk.c | 2 | ||||
-rw-r--r-- | drivers/s390/block/xpram.c | 2 | ||||
-rw-r--r-- | include/linux/blkdev.h | 3 |
14 files changed, 18 insertions, 20 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 8592409db272..31b5ece6b18e 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -1723,7 +1723,7 @@ static blk_qc_t blk_queue_bio(struct request_queue *q, struct bio *bio) | |||
1723 | */ | 1723 | */ |
1724 | blk_queue_bounce(q, &bio); | 1724 | blk_queue_bounce(q, &bio); |
1725 | 1725 | ||
1726 | blk_queue_split(q, &bio, q->bio_split); | 1726 | blk_queue_split(q, &bio); |
1727 | 1727 | ||
1728 | if (bio_integrity_enabled(bio) && bio_integrity_prep(bio)) { | 1728 | if (bio_integrity_enabled(bio) && bio_integrity_prep(bio)) { |
1729 | bio->bi_status = BLK_STS_IOERR; | 1729 | bio->bi_status = BLK_STS_IOERR; |
diff --git a/block/blk-merge.c b/block/blk-merge.c index 3990ae406341..d59074556703 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c | |||
@@ -202,8 +202,7 @@ split: | |||
202 | return do_split ? new : NULL; | 202 | return do_split ? new : NULL; |
203 | } | 203 | } |
204 | 204 | ||
205 | void blk_queue_split(struct request_queue *q, struct bio **bio, | 205 | void blk_queue_split(struct request_queue *q, struct bio **bio) |
206 | struct bio_set *bs) | ||
207 | { | 206 | { |
208 | struct bio *split, *res; | 207 | struct bio *split, *res; |
209 | unsigned nsegs; | 208 | unsigned nsegs; |
@@ -211,13 +210,13 @@ void blk_queue_split(struct request_queue *q, struct bio **bio, | |||
211 | switch (bio_op(*bio)) { | 210 | switch (bio_op(*bio)) { |
212 | case REQ_OP_DISCARD: | 211 | case REQ_OP_DISCARD: |
213 | case REQ_OP_SECURE_ERASE: | 212 | case REQ_OP_SECURE_ERASE: |
214 | split = blk_bio_discard_split(q, *bio, bs, &nsegs); | 213 | split = blk_bio_discard_split(q, *bio, q->bio_split, &nsegs); |
215 | break; | 214 | break; |
216 | case REQ_OP_WRITE_ZEROES: | 215 | case REQ_OP_WRITE_ZEROES: |
217 | split = blk_bio_write_zeroes_split(q, *bio, bs, &nsegs); | 216 | split = blk_bio_write_zeroes_split(q, *bio, q->bio_split, &nsegs); |
218 | break; | 217 | break; |
219 | case REQ_OP_WRITE_SAME: | 218 | case REQ_OP_WRITE_SAME: |
220 | split = blk_bio_write_same_split(q, *bio, bs, &nsegs); | 219 | split = blk_bio_write_same_split(q, *bio, q->bio_split, &nsegs); |
221 | break; | 220 | break; |
222 | default: | 221 | default: |
223 | split = blk_bio_segment_split(q, *bio, q->bio_split, &nsegs); | 222 | split = blk_bio_segment_split(q, *bio, q->bio_split, &nsegs); |
diff --git a/block/blk-mq.c b/block/blk-mq.c index be40c1d6e3a4..cc85de9d6b2d 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
@@ -1499,7 +1499,7 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) | |||
1499 | 1499 | ||
1500 | blk_queue_bounce(q, &bio); | 1500 | blk_queue_bounce(q, &bio); |
1501 | 1501 | ||
1502 | blk_queue_split(q, &bio, q->bio_split); | 1502 | blk_queue_split(q, &bio); |
1503 | 1503 | ||
1504 | if (bio_integrity_enabled(bio) && bio_integrity_prep(bio)) { | 1504 | if (bio_integrity_enabled(bio) && bio_integrity_prep(bio)) { |
1505 | bio_io_error(bio); | 1505 | bio_io_error(bio); |
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c index fca6b9914948..f6e865b2d543 100644 --- a/drivers/block/drbd/drbd_req.c +++ b/drivers/block/drbd/drbd_req.c | |||
@@ -1560,7 +1560,7 @@ blk_qc_t drbd_make_request(struct request_queue *q, struct bio *bio) | |||
1560 | struct drbd_device *device = (struct drbd_device *) q->queuedata; | 1560 | struct drbd_device *device = (struct drbd_device *) q->queuedata; |
1561 | unsigned long start_jif; | 1561 | unsigned long start_jif; |
1562 | 1562 | ||
1563 | blk_queue_split(q, &bio, q->bio_split); | 1563 | blk_queue_split(q, &bio); |
1564 | 1564 | ||
1565 | start_jif = jiffies; | 1565 | start_jif = jiffies; |
1566 | 1566 | ||
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index e8a381161db6..1f363638b453 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -2414,7 +2414,7 @@ static blk_qc_t pkt_make_request(struct request_queue *q, struct bio *bio) | |||
2414 | 2414 | ||
2415 | blk_queue_bounce(q, &bio); | 2415 | blk_queue_bounce(q, &bio); |
2416 | 2416 | ||
2417 | blk_queue_split(q, &bio, q->bio_split); | 2417 | blk_queue_split(q, &bio); |
2418 | 2418 | ||
2419 | pd = q->queuedata; | 2419 | pd = q->queuedata; |
2420 | if (!pd) { | 2420 | if (!pd) { |
diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c index 6fa2b8197013..e0e81cacd781 100644 --- a/drivers/block/ps3vram.c +++ b/drivers/block/ps3vram.c | |||
@@ -606,7 +606,7 @@ static blk_qc_t ps3vram_make_request(struct request_queue *q, struct bio *bio) | |||
606 | 606 | ||
607 | dev_dbg(&dev->core, "%s\n", __func__); | 607 | dev_dbg(&dev->core, "%s\n", __func__); |
608 | 608 | ||
609 | blk_queue_split(q, &bio, q->bio_split); | 609 | blk_queue_split(q, &bio); |
610 | 610 | ||
611 | spin_lock_irq(&priv->lock); | 611 | spin_lock_irq(&priv->lock); |
612 | busy = !bio_list_empty(&priv->list); | 612 | busy = !bio_list_empty(&priv->list); |
diff --git a/drivers/block/rsxx/dev.c b/drivers/block/rsxx/dev.c index 0b0a0a902355..4e8bdfa0aa31 100644 --- a/drivers/block/rsxx/dev.c +++ b/drivers/block/rsxx/dev.c | |||
@@ -151,7 +151,7 @@ static blk_qc_t rsxx_make_request(struct request_queue *q, struct bio *bio) | |||
151 | struct rsxx_bio_meta *bio_meta; | 151 | struct rsxx_bio_meta *bio_meta; |
152 | blk_status_t st = BLK_STS_IOERR; | 152 | blk_status_t st = BLK_STS_IOERR; |
153 | 153 | ||
154 | blk_queue_split(q, &bio, q->bio_split); | 154 | blk_queue_split(q, &bio); |
155 | 155 | ||
156 | might_sleep(); | 156 | might_sleep(); |
157 | 157 | ||
diff --git a/drivers/block/umem.c b/drivers/block/umem.c index 4b3c947697b1..0677d2514665 100644 --- a/drivers/block/umem.c +++ b/drivers/block/umem.c | |||
@@ -529,7 +529,7 @@ static blk_qc_t mm_make_request(struct request_queue *q, struct bio *bio) | |||
529 | (unsigned long long)bio->bi_iter.bi_sector, | 529 | (unsigned long long)bio->bi_iter.bi_sector, |
530 | bio->bi_iter.bi_size); | 530 | bio->bi_iter.bi_size); |
531 | 531 | ||
532 | blk_queue_split(q, &bio, q->bio_split); | 532 | blk_queue_split(q, &bio); |
533 | 533 | ||
534 | spin_lock_irq(&card->lock); | 534 | spin_lock_irq(&card->lock); |
535 | *card->biotail = bio; | 535 | *card->biotail = bio; |
diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c index ae8cd6d5af8b..b3fec8ec55b8 100644 --- a/drivers/lightnvm/pblk-init.c +++ b/drivers/lightnvm/pblk-init.c | |||
@@ -33,7 +33,7 @@ static int pblk_rw_io(struct request_queue *q, struct pblk *pblk, | |||
33 | * constraint. Writes can be of arbitrary size. | 33 | * constraint. Writes can be of arbitrary size. |
34 | */ | 34 | */ |
35 | if (bio_data_dir(bio) == READ) { | 35 | if (bio_data_dir(bio) == READ) { |
36 | blk_queue_split(q, &bio, q->bio_split); | 36 | blk_queue_split(q, &bio); |
37 | ret = pblk_submit_read(pblk, bio); | 37 | ret = pblk_submit_read(pblk, bio); |
38 | if (ret == NVM_IO_DONE && bio_flagged(bio, BIO_CLONED)) | 38 | if (ret == NVM_IO_DONE && bio_flagged(bio, BIO_CLONED)) |
39 | bio_put(bio); | 39 | bio_put(bio); |
@@ -46,7 +46,7 @@ static int pblk_rw_io(struct request_queue *q, struct pblk *pblk, | |||
46 | * available for user I/O. | 46 | * available for user I/O. |
47 | */ | 47 | */ |
48 | if (unlikely(pblk_get_secs(bio) >= pblk_rl_sysfs_rate_show(&pblk->rl))) | 48 | if (unlikely(pblk_get_secs(bio) >= pblk_rl_sysfs_rate_show(&pblk->rl))) |
49 | blk_queue_split(q, &bio, q->bio_split); | 49 | blk_queue_split(q, &bio); |
50 | 50 | ||
51 | return pblk_write_to_cache(pblk, bio, PBLK_IOTYPE_USER); | 51 | return pblk_write_to_cache(pblk, bio, PBLK_IOTYPE_USER); |
52 | } | 52 | } |
diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c index 8d3b53bb3307..267f01ae87e4 100644 --- a/drivers/lightnvm/rrpc.c +++ b/drivers/lightnvm/rrpc.c | |||
@@ -994,7 +994,7 @@ static blk_qc_t rrpc_make_rq(struct request_queue *q, struct bio *bio) | |||
994 | struct nvm_rq *rqd; | 994 | struct nvm_rq *rqd; |
995 | int err; | 995 | int err; |
996 | 996 | ||
997 | blk_queue_split(q, &bio, q->bio_split); | 997 | blk_queue_split(q, &bio); |
998 | 998 | ||
999 | if (bio_op(bio) == REQ_OP_DISCARD) { | 999 | if (bio_op(bio) == REQ_OP_DISCARD) { |
1000 | rrpc_discard(rrpc, bio); | 1000 | rrpc_discard(rrpc, bio); |
diff --git a/drivers/md/md.c b/drivers/md/md.c index 6d493b54d56c..d43df1176c23 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -265,7 +265,7 @@ static blk_qc_t md_make_request(struct request_queue *q, struct bio *bio) | |||
265 | unsigned int sectors; | 265 | unsigned int sectors; |
266 | int cpu; | 266 | int cpu; |
267 | 267 | ||
268 | blk_queue_split(q, &bio, q->bio_split); | 268 | blk_queue_split(q, &bio); |
269 | 269 | ||
270 | if (mddev == NULL || mddev->pers == NULL) { | 270 | if (mddev == NULL || mddev->pers == NULL) { |
271 | bio_io_error(bio); | 271 | bio_io_error(bio); |
diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c index 36e5280af3e4..06eb1de52d1c 100644 --- a/drivers/s390/block/dcssblk.c +++ b/drivers/s390/block/dcssblk.c | |||
@@ -845,7 +845,7 @@ dcssblk_make_request(struct request_queue *q, struct bio *bio) | |||
845 | unsigned long source_addr; | 845 | unsigned long source_addr; |
846 | unsigned long bytes_done; | 846 | unsigned long bytes_done; |
847 | 847 | ||
848 | blk_queue_split(q, &bio, q->bio_split); | 848 | blk_queue_split(q, &bio); |
849 | 849 | ||
850 | bytes_done = 0; | 850 | bytes_done = 0; |
851 | dev_info = bio->bi_bdev->bd_disk->private_data; | 851 | dev_info = bio->bi_bdev->bd_disk->private_data; |
diff --git a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c index b9d7e755c8a3..a48f0d40c1d2 100644 --- a/drivers/s390/block/xpram.c +++ b/drivers/s390/block/xpram.c | |||
@@ -190,7 +190,7 @@ static blk_qc_t xpram_make_request(struct request_queue *q, struct bio *bio) | |||
190 | unsigned long page_addr; | 190 | unsigned long page_addr; |
191 | unsigned long bytes; | 191 | unsigned long bytes; |
192 | 192 | ||
193 | blk_queue_split(q, &bio, q->bio_split); | 193 | blk_queue_split(q, &bio); |
194 | 194 | ||
195 | if ((bio->bi_iter.bi_sector & 7) != 0 || | 195 | if ((bio->bi_iter.bi_sector & 7) != 0 || |
196 | (bio->bi_iter.bi_size & 4095) != 0) | 196 | (bio->bi_iter.bi_size & 4095) != 0) |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 76b6df862a12..670df402bc51 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -944,8 +944,7 @@ extern blk_status_t blk_insert_cloned_request(struct request_queue *q, | |||
944 | struct request *rq); | 944 | struct request *rq); |
945 | extern int blk_rq_append_bio(struct request *rq, struct bio *bio); | 945 | extern int blk_rq_append_bio(struct request *rq, struct bio *bio); |
946 | extern void blk_delay_queue(struct request_queue *, unsigned long); | 946 | extern void blk_delay_queue(struct request_queue *, unsigned long); |
947 | extern void blk_queue_split(struct request_queue *, struct bio **, | 947 | extern void blk_queue_split(struct request_queue *, struct bio **); |
948 | struct bio_set *); | ||
949 | extern void blk_recount_segments(struct request_queue *, struct bio *); | 948 | extern void blk_recount_segments(struct request_queue *, struct bio *); |
950 | extern int scsi_verify_blk_ioctl(struct block_device *, unsigned int); | 949 | extern int scsi_verify_blk_ioctl(struct block_device *, unsigned int); |
951 | extern int scsi_cmd_blk_ioctl(struct block_device *, fmode_t, | 950 | extern int scsi_cmd_blk_ioctl(struct block_device *, fmode_t, |