All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] blk-mq/sbitmap: Delete some unused functions
@ 2019-11-13 17:27 John Garry
  2019-11-13 17:27 ` [PATCH 1/2] blk-mq: Delete blk_mq_has_free_tags() and blk_mq_can_queue() John Garry
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: John Garry @ 2019-11-13 17:27 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel, John Garry

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(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] blk-mq: Delete blk_mq_has_free_tags() and blk_mq_can_queue()
  2019-11-13 17:27 [PATCH 0/2] blk-mq/sbitmap: Delete some unused functions John Garry
@ 2019-11-13 17:27 ` John Garry
  2019-11-13 17:27 ` [PATCH 2/2] sbitmap: Delete sbitmap_any_bit_clear() John Garry
  2019-11-13 19:51 ` [PATCH 0/2] blk-mq/sbitmap: Delete some unused functions Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: John Garry @ 2019-11-13 17:27 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel, John Garry

These functions are not referenced, so delete them.

Signed-off-by: John Garry <john.garry@huawei.com>
---
 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(-)

diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
index 008388e82b5c..fbacde454718 100644
--- a/block/blk-mq-tag.c
+++ b/block/blk-mq-tag.c
@@ -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
diff --git a/block/blk-mq-tag.h b/block/blk-mq-tag.h
index 61deab0b5a5a..15bc74acb57e 100644
--- a/block/blk-mq-tag.h
+++ b/block/blk-mq-tag.h
@@ -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);
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 5c9adcaa27ac..323c9cb28066 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -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.
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index dc03e059fdff..11cfd6470b1a 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -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);
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] sbitmap: Delete sbitmap_any_bit_clear()
  2019-11-13 17:27 [PATCH 0/2] blk-mq/sbitmap: Delete some unused functions John Garry
  2019-11-13 17:27 ` [PATCH 1/2] blk-mq: Delete blk_mq_has_free_tags() and blk_mq_can_queue() John Garry
@ 2019-11-13 17:27 ` John Garry
  2019-11-13 19:51 ` [PATCH 0/2] blk-mq/sbitmap: Delete some unused functions Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: John Garry @ 2019-11-13 17:27 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel, John Garry

Since the only caller of this function has been deleted, delete this one
also.

Signed-off-by: John Garry <john.garry@huawei.com>
---
 include/linux/sbitmap.h |  9 ---------
 lib/sbitmap.c           | 17 -----------------
 2 files changed, 26 deletions(-)

diff --git a/include/linux/sbitmap.h b/include/linux/sbitmap.h
index a986ac12a848..e40d019c3d9d 100644
--- a/include/linux/sbitmap.h
+++ b/include/linux/sbitmap.h
@@ -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))
 
diff --git a/lib/sbitmap.c b/lib/sbitmap.c
index 969e5400a615..33feec8989f1 100644
--- a/lib/sbitmap.c
+++ b/lib/sbitmap.c
@@ -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;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] blk-mq/sbitmap: Delete some unused functions
  2019-11-13 17:27 [PATCH 0/2] blk-mq/sbitmap: Delete some unused functions John Garry
  2019-11-13 17:27 ` [PATCH 1/2] blk-mq: Delete blk_mq_has_free_tags() and blk_mq_can_queue() John Garry
  2019-11-13 17:27 ` [PATCH 2/2] sbitmap: Delete sbitmap_any_bit_clear() John Garry
@ 2019-11-13 19:51 ` Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2019-11-13 19:51 UTC (permalink / raw)
  To: John Garry; +Cc: linux-block, linux-kernel

On 11/13/19 10:27 AM, John Garry wrote:
> 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.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-11-13 19:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-13 17:27 [PATCH 0/2] blk-mq/sbitmap: Delete some unused functions John Garry
2019-11-13 17:27 ` [PATCH 1/2] blk-mq: Delete blk_mq_has_free_tags() and blk_mq_can_queue() John Garry
2019-11-13 17:27 ` [PATCH 2/2] sbitmap: Delete sbitmap_any_bit_clear() John Garry
2019-11-13 19:51 ` [PATCH 0/2] blk-mq/sbitmap: Delete some unused functions Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.