Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

NeilBrown and committed by
Jens Axboe
af67c31f e4cdf1a1

+18 -20
+1 -1
block/blk-core.c
··· 1723 1723 */ 1724 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 1728 if (bio_integrity_enabled(bio) && bio_integrity_prep(bio)) { 1729 1729 bio->bi_status = BLK_STS_IOERR;
+4 -5
block/blk-merge.c
··· 202 202 return do_split ? new : NULL; 203 203 } 204 204 205 - void blk_queue_split(struct request_queue *q, struct bio **bio, 206 - struct bio_set *bs) 205 + void blk_queue_split(struct request_queue *q, struct bio **bio) 207 206 { 208 207 struct bio *split, *res; 209 208 unsigned nsegs; ··· 210 211 switch (bio_op(*bio)) { 211 212 case REQ_OP_DISCARD: 212 213 case REQ_OP_SECURE_ERASE: 213 - split = blk_bio_discard_split(q, *bio, bs, &nsegs); 214 + split = blk_bio_discard_split(q, *bio, q->bio_split, &nsegs); 214 215 break; 215 216 case REQ_OP_WRITE_ZEROES: 216 - split = blk_bio_write_zeroes_split(q, *bio, bs, &nsegs); 217 + split = blk_bio_write_zeroes_split(q, *bio, q->bio_split, &nsegs); 217 218 break; 218 219 case REQ_OP_WRITE_SAME: 219 - split = blk_bio_write_same_split(q, *bio, bs, &nsegs); 220 + split = blk_bio_write_same_split(q, *bio, q->bio_split, &nsegs); 220 221 break; 221 222 default: 222 223 split = blk_bio_segment_split(q, *bio, q->bio_split, &nsegs);
+1 -1
block/blk-mq.c
··· 1499 1499 1500 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 1504 if (bio_integrity_enabled(bio) && bio_integrity_prep(bio)) { 1505 1505 bio_io_error(bio);
+1 -1
drivers/block/drbd/drbd_req.c
··· 1560 1560 struct drbd_device *device = (struct drbd_device *) q->queuedata; 1561 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 1565 start_jif = jiffies; 1566 1566
+1 -1
drivers/block/pktcdvd.c
··· 2414 2414 2415 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 2419 pd = q->queuedata; 2420 2420 if (!pd) {
+1 -1
drivers/block/ps3vram.c
··· 606 606 607 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 611 spin_lock_irq(&priv->lock); 612 612 busy = !bio_list_empty(&priv->list);
+1 -1
drivers/block/rsxx/dev.c
··· 151 151 struct rsxx_bio_meta *bio_meta; 152 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 156 might_sleep(); 157 157
+1 -1
drivers/block/umem.c
··· 529 529 (unsigned long long)bio->bi_iter.bi_sector, 530 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 534 spin_lock_irq(&card->lock); 535 535 *card->biotail = bio;
+2 -2
drivers/lightnvm/pblk-init.c
··· 33 33 * constraint. Writes can be of arbitrary size. 34 34 */ 35 35 if (bio_data_dir(bio) == READ) { 36 - blk_queue_split(q, &bio, q->bio_split); 36 + blk_queue_split(q, &bio); 37 37 ret = pblk_submit_read(pblk, bio); 38 38 if (ret == NVM_IO_DONE && bio_flagged(bio, BIO_CLONED)) 39 39 bio_put(bio); ··· 46 46 * available for user I/O. 47 47 */ 48 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 51 return pblk_write_to_cache(pblk, bio, PBLK_IOTYPE_USER); 52 52 }
+1 -1
drivers/lightnvm/rrpc.c
··· 994 994 struct nvm_rq *rqd; 995 995 int err; 996 996 997 - blk_queue_split(q, &bio, q->bio_split); 997 + blk_queue_split(q, &bio); 998 998 999 999 if (bio_op(bio) == REQ_OP_DISCARD) { 1000 1000 rrpc_discard(rrpc, bio);
+1 -1
drivers/md/md.c
··· 265 265 unsigned int sectors; 266 266 int cpu; 267 267 268 - blk_queue_split(q, &bio, q->bio_split); 268 + blk_queue_split(q, &bio); 269 269 270 270 if (mddev == NULL || mddev->pers == NULL) { 271 271 bio_io_error(bio);
+1 -1
drivers/s390/block/dcssblk.c
··· 845 845 unsigned long source_addr; 846 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 850 bytes_done = 0; 851 851 dev_info = bio->bi_bdev->bd_disk->private_data;
+1 -1
drivers/s390/block/xpram.c
··· 190 190 unsigned long page_addr; 191 191 unsigned long bytes; 192 192 193 - blk_queue_split(q, &bio, q->bio_split); 193 + blk_queue_split(q, &bio); 194 194 195 195 if ((bio->bi_iter.bi_sector & 7) != 0 || 196 196 (bio->bi_iter.bi_size & 4095) != 0)
+1 -2
include/linux/blkdev.h
··· 944 944 struct request *rq); 945 945 extern int blk_rq_append_bio(struct request *rq, struct bio *bio); 946 946 extern void blk_delay_queue(struct request_queue *, unsigned long); 947 - extern void blk_queue_split(struct request_queue *, struct bio **, 948 - struct bio_set *); 947 + extern void blk_queue_split(struct request_queue *, struct bio **); 949 948 extern void blk_recount_segments(struct request_queue *, struct bio *); 950 949 extern int scsi_verify_blk_ioctl(struct block_device *, unsigned int); 951 950 extern int scsi_cmd_blk_ioctl(struct block_device *, fmode_t,