Skip to content

Commit cae740a

Browse files
John Garryaxboe
authored andcommitted
blk-mq: Remove some unused function arguments
The struct blk_mq_hw_ctx pointer argument in blk_mq_put_tag(), blk_mq_poll_nsecs(), and blk_mq_poll_hybrid_sleep() is unused, so remove it. Overall obj code size shows a minor reduction, before: text data bss dec hex filename 27306 1312 0 28618 6fca block/blk-mq.o 4303 272 0 4575 11df block/blk-mq-tag.o after: 27282 1312 0 28594 6fb2 block/blk-mq.o 4311 272 0 4583 11e7 block/blk-mq-tag.o Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: John Garry <[email protected]> -- This minor patch had been carried as part of the blk-mq shared tags RFC, I'd rather not carry it anymore as it required rebasing, so now or never.. Signed-off-by: Jens Axboe <[email protected]>
1 parent 93d7c31 commit cae740a

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

block/blk-mq-tag.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ unsigned int blk_mq_get_tag(struct blk_mq_alloc_data *data)
183183
return tag + tag_offset;
184184
}
185185

186-
void blk_mq_put_tag(struct blk_mq_hw_ctx *hctx, struct blk_mq_tags *tags,
187-
struct blk_mq_ctx *ctx, unsigned int tag)
186+
void blk_mq_put_tag(struct blk_mq_tags *tags, struct blk_mq_ctx *ctx,
187+
unsigned int tag)
188188
{
189189
if (!blk_mq_tag_is_reserved(tags, tag)) {
190190
const int real_tag = tag - tags->nr_reserved_tags;

block/blk-mq-tag.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ extern struct blk_mq_tags *blk_mq_init_tags(unsigned int nr_tags, unsigned int r
2626
extern void blk_mq_free_tags(struct blk_mq_tags *tags);
2727

2828
extern unsigned int blk_mq_get_tag(struct blk_mq_alloc_data *data);
29-
extern void blk_mq_put_tag(struct blk_mq_hw_ctx *hctx, struct blk_mq_tags *tags,
30-
struct blk_mq_ctx *ctx, unsigned int tag);
29+
extern void blk_mq_put_tag(struct blk_mq_tags *tags, struct blk_mq_ctx *ctx,
30+
unsigned int tag);
3131
extern int blk_mq_tag_update_depth(struct blk_mq_hw_ctx *hctx,
3232
struct blk_mq_tags **tags,
3333
unsigned int depth, bool can_grow);

block/blk-mq.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -477,9 +477,9 @@ static void __blk_mq_free_request(struct request *rq)
477477
blk_pm_mark_last_busy(rq);
478478
rq->mq_hctx = NULL;
479479
if (rq->tag != -1)
480-
blk_mq_put_tag(hctx, hctx->tags, ctx, rq->tag);
480+
blk_mq_put_tag(hctx->tags, ctx, rq->tag);
481481
if (sched_tag != -1)
482-
blk_mq_put_tag(hctx, hctx->sched_tags, ctx, sched_tag);
482+
blk_mq_put_tag(hctx->sched_tags, ctx, sched_tag);
483483
blk_mq_sched_restart(hctx);
484484
blk_queue_exit(q);
485485
}
@@ -3402,7 +3402,6 @@ static void blk_mq_poll_stats_fn(struct blk_stat_callback *cb)
34023402
}
34033403

34043404
static unsigned long blk_mq_poll_nsecs(struct request_queue *q,
3405-
struct blk_mq_hw_ctx *hctx,
34063405
struct request *rq)
34073406
{
34083407
unsigned long ret = 0;
@@ -3435,7 +3434,6 @@ static unsigned long blk_mq_poll_nsecs(struct request_queue *q,
34353434
}
34363435

34373436
static bool blk_mq_poll_hybrid_sleep(struct request_queue *q,
3438-
struct blk_mq_hw_ctx *hctx,
34393437
struct request *rq)
34403438
{
34413439
struct hrtimer_sleeper hs;
@@ -3455,7 +3453,7 @@ static bool blk_mq_poll_hybrid_sleep(struct request_queue *q,
34553453
if (q->poll_nsec > 0)
34563454
nsecs = q->poll_nsec;
34573455
else
3458-
nsecs = blk_mq_poll_nsecs(q, hctx, rq);
3456+
nsecs = blk_mq_poll_nsecs(q, rq);
34593457

34603458
if (!nsecs)
34613459
return false;
@@ -3510,7 +3508,7 @@ static bool blk_mq_poll_hybrid(struct request_queue *q,
35103508
return false;
35113509
}
35123510

3513-
return blk_mq_poll_hybrid_sleep(q, hctx, rq);
3511+
return blk_mq_poll_hybrid_sleep(q, rq);
35143512
}
35153513

35163514
/**

block/blk-mq.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ static inline bool blk_mq_get_dispatch_budget(struct blk_mq_hw_ctx *hctx)
200200
static inline void __blk_mq_put_driver_tag(struct blk_mq_hw_ctx *hctx,
201201
struct request *rq)
202202
{
203-
blk_mq_put_tag(hctx, hctx->tags, rq->mq_ctx, rq->tag);
203+
blk_mq_put_tag(hctx->tags, rq->mq_ctx, rq->tag);
204204
rq->tag = -1;
205205

206206
if (rq->rq_flags & RQF_MQ_INFLIGHT) {

0 commit comments

Comments
 (0)