aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2014-11-24 17:52:30 -0500
committerJens Axboe <axboe@fb.com>2014-11-24 17:52:30 -0500
commit70114c393ccaa43ca38e6b36b9469ed2c35acc49 (patch)
treef14673ccf7172de39888c18a5e201e9f5dcf0c53 /block
parenta33c1ba2913802b6fb23e974bb2f6a4e73c8b7ce (diff)
blk-mq: cleanup tag free handling
We only call __blk_mq_put_tag() and __blk_mq_put_reserved_tag() from blk_mq_put_tag(), so just inline the two calls instead of having them as separate functions. Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq-tag.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
index 8317175a3009..230ef3056b72 100644
--- a/block/blk-mq-tag.c
+++ b/block/blk-mq-tag.c
@@ -360,21 +360,6 @@ static void bt_clear_tag(struct blk_mq_bitmap_tags *bt, unsigned int tag)
360 } 360 }
361} 361}
362 362
363static void __blk_mq_put_tag(struct blk_mq_tags *tags, unsigned int tag)
364{
365 BUG_ON(tag >= tags->nr_tags);
366
367 bt_clear_tag(&tags->bitmap_tags, tag);
368}
369
370static void __blk_mq_put_reserved_tag(struct blk_mq_tags *tags,
371 unsigned int tag)
372{
373 BUG_ON(tag >= tags->nr_reserved_tags);
374
375 bt_clear_tag(&tags->breserved_tags, tag);
376}
377
378void blk_mq_put_tag(struct blk_mq_hw_ctx *hctx, unsigned int tag, 363void blk_mq_put_tag(struct blk_mq_hw_ctx *hctx, unsigned int tag,
379 unsigned int *last_tag) 364 unsigned int *last_tag)
380{ 365{
@@ -383,10 +368,13 @@ void blk_mq_put_tag(struct blk_mq_hw_ctx *hctx, unsigned int tag,
383 if (tag >= tags->nr_reserved_tags) { 368 if (tag >= tags->nr_reserved_tags) {
384 const int real_tag = tag - tags->nr_reserved_tags; 369 const int real_tag = tag - tags->nr_reserved_tags;
385 370
386 __blk_mq_put_tag(tags, real_tag); 371 BUG_ON(real_tag >= tags->nr_tags);
372 bt_clear_tag(&tags->bitmap_tags, real_tag);
387 *last_tag = real_tag; 373 *last_tag = real_tag;
388 } else 374 } else {
389 __blk_mq_put_reserved_tag(tags, tag); 375 BUG_ON(tag >= tags->nr_reserved_tags);
376 bt_clear_tag(&tags->breserved_tags, tag);
377 }
390} 378}
391 379
392static void bt_for_each(struct blk_mq_hw_ctx *hctx, 380static void bt_for_each(struct blk_mq_hw_ctx *hctx,