Skip to content

Commit f695ca3

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: remove the request_queue argument from blk_queue_split
The queue can be trivially derived from the bio, so pass one less argument. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent ed9b319 commit f695ca3

15 files changed

Lines changed: 28 additions & 31 deletions

File tree

‎block/blk-merge.c‎

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -283,20 +283,20 @@ static struct bio *blk_bio_segment_split(struct request_queue *q,
283283

284284
/**
285285
* __blk_queue_split - split a bio and submit the second half
286-
* @q: [in] request queue pointer
287286
* @bio: [in, out] bio to be split
288287
* @nr_segs: [out] number of segments in the first bio
289288
*
290289
* Split a bio into two bios, chain the two bios, submit the second half and
291290
* store a pointer to the first half in *@bio. If the second bio is still too
292291
* big it will be split by a recursive call to this function. Since this
293-
* function may allocate a new bio from @q->bio_split, it is the responsibility
294-
* of the caller to ensure that @q is only released after processing of the
292+
* function may allocate a new bio from @bio->bi_disk->queue->bio_split, it is
293+
* the responsibility of the caller to ensure that
294+
* @bio->bi_disk->queue->bio_split is only released after processing of the
295295
* split bio has finished.
296296
*/
297-
void __blk_queue_split(struct request_queue *q, struct bio **bio,
298-
unsigned int *nr_segs)
297+
void __blk_queue_split(struct bio **bio, unsigned int *nr_segs)
299298
{
299+
struct request_queue *q = (*bio)->bi_disk->queue;
300300
struct bio *split = NULL;
301301

302302
switch (bio_op(*bio)) {
@@ -345,20 +345,19 @@ void __blk_queue_split(struct request_queue *q, struct bio **bio,
345345

346346
/**
347347
* blk_queue_split - split a bio and submit the second half
348-
* @q: [in] request queue pointer
349348
* @bio: [in, out] bio to be split
350349
*
351350
* Split a bio into two bios, chains the two bios, submit the second half and
352351
* store a pointer to the first half in *@bio. Since this function may allocate
353-
* a new bio from @q->bio_split, it is the responsibility of the caller to
354-
* ensure that @q is only released after processing of the split bio has
355-
* finished.
352+
* a new bio from @bio->bi_disk->queue->bio_split, it is the responsibility of
353+
* the caller to ensure that @bio->bi_disk->queue->bio_split is only released
354+
* after processing of the split bio has finished.
356355
*/
357-
void blk_queue_split(struct request_queue *q, struct bio **bio)
356+
void blk_queue_split(struct bio **bio)
358357
{
359358
unsigned int nr_segs;
360359

361-
__blk_queue_split(q, bio, &nr_segs);
360+
__blk_queue_split(bio, &nr_segs);
362361
}
363362
EXPORT_SYMBOL(blk_queue_split);
364363

‎block/blk-mq.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2166,7 +2166,7 @@ blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio)
21662166
blk_status_t ret;
21672167

21682168
blk_queue_bounce(q, &bio);
2169-
__blk_queue_split(q, &bio, &nr_segs);
2169+
__blk_queue_split(&bio, &nr_segs);
21702170

21712171
if (!bio_integrity_prep(bio))
21722172
goto queue_exit;

‎block/blk.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,7 @@ ssize_t part_timeout_show(struct device *, struct device_attribute *, char *);
220220
ssize_t part_timeout_store(struct device *, struct device_attribute *,
221221
const char *, size_t);
222222

223-
void __blk_queue_split(struct request_queue *q, struct bio **bio,
224-
unsigned int *nr_segs);
223+
void __blk_queue_split(struct bio **bio, unsigned int *nr_segs);
225224
int ll_back_merge_fn(struct request *req, struct bio *bio,
226225
unsigned int nr_segs);
227226
int ll_front_merge_fn(struct request *req, struct bio *bio,

‎drivers/block/drbd/drbd_req.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1598,7 +1598,7 @@ blk_qc_t drbd_make_request(struct request_queue *q, struct bio *bio)
15981598
struct drbd_device *device = bio->bi_disk->private_data;
15991599
unsigned long start_jif;
16001600

1601-
blk_queue_split(q, &bio);
1601+
blk_queue_split(&bio);
16021602

16031603
start_jif = jiffies;
16041604

‎drivers/block/pktcdvd.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2434,7 +2434,7 @@ static blk_qc_t pkt_make_request(struct request_queue *q, struct bio *bio)
24342434
char b[BDEVNAME_SIZE];
24352435
struct bio *split;
24362436

2437-
blk_queue_split(q, &bio);
2437+
blk_queue_split(&bio);
24382438

24392439
pd = q->queuedata;
24402440
if (!pd) {

‎drivers/block/ps3vram.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ static blk_qc_t ps3vram_make_request(struct request_queue *q, struct bio *bio)
593593

594594
dev_dbg(&dev->core, "%s\n", __func__);
595595

596-
blk_queue_split(q, &bio);
596+
blk_queue_split(&bio);
597597

598598
spin_lock_irq(&priv->lock);
599599
busy = !bio_list_empty(&priv->list);

‎drivers/block/rsxx/dev.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ static blk_qc_t rsxx_make_request(struct request_queue *q, struct bio *bio)
123123
struct rsxx_bio_meta *bio_meta;
124124
blk_status_t st = BLK_STS_IOERR;
125125

126-
blk_queue_split(q, &bio);
126+
blk_queue_split(&bio);
127127

128128
might_sleep();
129129

‎drivers/block/umem.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ static blk_qc_t mm_make_request(struct request_queue *q, struct bio *bio)
527527
(unsigned long long)bio->bi_iter.bi_sector,
528528
bio->bi_iter.bi_size);
529529

530-
blk_queue_split(q, &bio);
530+
blk_queue_split(&bio);
531531

532532
spin_lock_irq(&card->lock);
533533
*card->biotail = bio;

‎drivers/lightnvm/pblk-init.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ static blk_qc_t pblk_make_rq(struct request_queue *q, struct bio *bio)
6363
* constraint. Writes can be of arbitrary size.
6464
*/
6565
if (bio_data_dir(bio) == READ) {
66-
blk_queue_split(q, &bio);
66+
blk_queue_split(&bio);
6767
pblk_submit_read(pblk, bio);
6868
} else {
6969
/* Prevent deadlock in the case of a modest LUN configuration
7070
* and large user I/Os. Unless stalled, the rate limiter
7171
* leaves at least 256KB available for user I/O.
7272
*/
7373
if (pblk_get_secs(bio) > pblk_rl_max_io(&pblk->rl))
74-
blk_queue_split(q, &bio);
74+
blk_queue_split(&bio);
7575

7676
pblk_write_to_cache(pblk, bio, PBLK_IOTYPE_USER);
7777
}

‎drivers/md/dm.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1776,7 +1776,7 @@ static blk_qc_t dm_process_bio(struct mapped_device *md,
17761776
*/
17771777
if (current->bio_list) {
17781778
if (is_abnormal_io(bio))
1779-
blk_queue_split(md->queue, &bio);
1779+
blk_queue_split(&bio);
17801780
else
17811781
dm_queue_split(md, ti, &bio);
17821782
}

0 commit comments

Comments
 (0)