block: move ->bio_split to the gendisk

Only non-passthrough requests are split by the block layer and use the
->bio_split bio_set.  Move it from the request_queue to the gendisk.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20220727162300.3089193-4-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Christoph Hellwig
2022-07-27 12:22:57 -04:00
committed by Jens Axboe
parent 51d798cdb5
commit 46754bd056
6 changed files with 15 additions and 16 deletions

View File

@@ -331,18 +331,19 @@ split:
struct bio *__bio_split_to_limits(struct bio *bio, struct request_queue *q,
unsigned int *nr_segs)
{
struct bio_set *bs = &bio->bi_bdev->bd_disk->bio_split;
struct bio *split;
switch (bio_op(bio)) {
case REQ_OP_DISCARD:
case REQ_OP_SECURE_ERASE:
split = bio_split_discard(bio, q, nr_segs, &q->bio_split);
split = bio_split_discard(bio, q, nr_segs, bs);
break;
case REQ_OP_WRITE_ZEROES:
split = bio_split_write_zeroes(bio, q, nr_segs, &q->bio_split);
split = bio_split_write_zeroes(bio, q, nr_segs, bs);
break;
default:
split = bio_split_rw(bio, q, nr_segs, &q->bio_split);
split = bio_split_rw(bio, q, nr_segs, bs);
break;
}