blk-mq/sbitmap: Delete some unused functions
Subsystems (2)
cover blk-mq/sbitmap: Delete some unused functions
Function blk_mq_can_queue() never seemed to ever have been referenced, so delete it and any other now-unused callees.
John Garry (2):
blk-mq: Delete blk_mq_has_free_tags() and blk_mq_can_queue()
sbitmap: Delete sbitmap_any_bit_clear()
block/blk-mq-tag.c | 8 -------- block/blk-mq-tag.h | 1 - block/blk-mq.c | 6 ------ include/linux/blk-mq.h | 1 - include/linux/sbitmap.h | 9 --------- lib/sbitmap.c | 17 ----------------- 6 files changed, 42 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/2 blk-mq: Delete blk_mq_has_free_tags() and blk_mq_can_queue()
These functions are not referenced, so delete them.
Signed-off-by John Garry <[email protected]>
--- block/blk-mq-tag.c | 8 -------- block/blk-mq-tag.h | 1 - block/blk-mq.c | 6 ------ include/linux/blk-mq.h | 1 - 4 files changed, 16 deletions(-)
block/blk-mq-tag.c +0 -8
@@ -15,14 +15,6 @@#include "blk-mq.h" #include "blk-mq-tag.h" -bool blk_mq_has_free_tags (struct blk_mq_tags *tags) -{ -if (!tags) -return true; - -return sbitmap_any_bit_clear (&tags->bitmap_tags.sb); -} -/* * If a previously inactive queue goes active, bump the active user count. * We need to do this before try to allocate driver tag, then even if fail
block/blk-mq-tag.h +0 -1
@@ -28,7 +28,6 @@ extern void blk_mq_free_tags(struct blk_mq_tags *tags);extern unsigned int blk_mq_get_tag (struct blk_mq_alloc_data *data);extern void blk_mq_put_tag (struct blk_mq_hw_ctx *hctx,struct blk_mq_tags *tags,struct blk_mq_ctx *ctx,unsigned int tag); -extern bool blk_mq_has_free_tags (struct blk_mq_tags *tags);extern int blk_mq_tag_update_depth (struct blk_mq_hw_ctx *hctx,struct blk_mq_tags **tags,unsigned int depth,bool can_grow);
block/blk-mq.c +0 -6
@@ -260,12 +260,6 @@ void blk_mq_wake_waiters(struct request_queue *q)blk_mq_tag_wakeup_all (hctx->tags, true); } -bool blk_mq_can_queue (struct blk_mq_hw_ctx *hctx) -{ -return blk_mq_has_free_tags (hctx->tags); -} -EXPORT_SYMBOL (blk_mq_can_queue); -/* * Only need start/end time stamping if we have iostat or * blk stats enabled, or using an IO scheduler.
include/linux/blk-mq.h +0 -1
@@ -424,7 +424,6 @@ void blk_mq_free_tag_set(struct blk_mq_tag_set *set);void blk_mq_flush_plug_list (struct blk_plug *plug,bool from_schedule);void blk_mq_free_request (struct request *rq); -bool blk_mq_can_queue (struct blk_mq_hw_ctx *);bool blk_mq_queue_inflight (struct request_queue *q);
Signature · 1 line
2.17.1
PATCH 2/2 sbitmap: Delete sbitmap_any_bit_clear()
In reply to John GarrySince the only caller of this function has been deleted, delete this one also.
Signed-off-by John Garry <[email protected]>
--- include/linux/sbitmap.h | 9 --------- lib/sbitmap.c | 17 ----------------- 2 files changed, 26 deletions(-)
include/linux/sbitmap.h +0 -9
@@ -216,15 +216,6 @@ int sbitmap_get_shallow(struct sbitmap *sb, unsigned int alloc_hint,*/ bool sbitmap_any_bit_set (const struct sbitmap *sb); -/** -* sbitmap_any_bit_clear() - Check for an unset bit in a &struct -* sbitmap. -* @sb: Bitmap to check. -* -* Return: true if any bit in the bitmap is clear, false otherwise. -*/ -bool sbitmap_any_bit_clear (const struct sbitmap *sb); -#define SB_NR_TO_INDEX (sb, bitnr) ((bitnr) >> (sb)->shift)#define SB_NR_TO_BIT (sb, bitnr) ((bitnr) & ((1U << (sb)->shift) - 1U))
lib/sbitmap.c +0 -17
@@ -236,23 +236,6 @@ bool sbitmap_any_bit_set(const struct sbitmap *sb) }EXPORT_SYMBOL_GPL (sbitmap_any_bit_set); -bool sbitmap_any_bit_clear (const struct sbitmap *sb) -{ -unsigned int i; - -for (i =0 ; i < sb->map_nr; i++) { -const struct sbitmap_word *word = &sb->map[i]; -unsigned long mask = word->word & ~word->cleared; -unsigned long ret; - - ret =find_first_zero_bit (&mask, word->depth); -if (ret < word->depth) -return true; - } -return false; -} -EXPORT_SYMBOL_GPL (sbitmap_any_bit_clear); -static unsigned int __sbitmap_weight (const struct sbitmap *sb,bool set) {unsigned int i, weight =0 ;
Signature · 1 line
2.17.1
Jens Axboe
maintainerQuoted 2 lines · John Garry
Function
blk_mq_can_queue()never seemed to ever have been referenced, so delete it and any other now-unused callees.
Great, I like killing dead code. Applied for 5.5, thanks.
Signature · 1 line
Jens Axboe