block: remove QUEUE_FLAG_STOPPED
PATCH 1/1 block: remove QUEUE_FLAG_STOPPED
QUEUE_FLAG_STOPPED is entirely unused.
--- block/blk-mq-debugfs.c | 1 - include/linux/blkdev.h | 2 -- 2 files changed, 3 deletions(-)
block/blk-mq-debugfs.c +0 -1
@@ -79,7 +79,6 @@ static int queue_pm_only_show(void *data, struct seq_file *m)#define QUEUE_FLAG_NAME (name) [QUEUE_FLAG_##name] = #namestatic const char *const blk_queue_flag_name[] = { -QUEUE_FLAG_NAME (STOPPED ),QUEUE_FLAG_NAME (DYING ),QUEUE_FLAG_NAME (NOMERGES ),QUEUE_FLAG_NAME (SAME_COMP ),
include/linux/blkdev.h +0 -2
@@ -590,7 +590,6 @@ struct request_queue { };/* Keep blk_queue_flag_name[] in sync with the definitions below */ -#define QUEUE_FLAG_STOPPED 0/* queue is stopped */ #define QUEUE_FLAG_DYING 1/* queue being torn down */ #define QUEUE_FLAG_NOMERGES 3/* disable merge attempts */ #define QUEUE_FLAG_SAME_COMP 4/* complete on same CPU-group */
@@ -610,7 +609,6 @@ struct request_queue {void blk_queue_flag_set (unsigned int flag,struct request_queue *q);void blk_queue_flag_clear (unsigned int flag,struct request_queue *q); -#define blk_queue_stopped (q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags)#define blk_queue_dying (q) test_bit(QUEUE_FLAG_DYING, &(q)->queue_flags)#define blk_queue_init_done (q) test_bit(QUEUE_FLAG_INIT_DONE, &(q)->queue_flags)#define blk_queue_nomerges (q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags)
Signature · 1 line
2.43.0
Quoted 1 line · Christoph Hellwig
QUEUE_FLAG_STOPPEDis entirely unused.
Is this perhaps the patch that removed all QUEUE_FLAG_STOPPED users? a1ce35fa4985 ("block: remove dead elevator code")
Anyway:
Looks good,
Quoted 25 lines · Christoph Hellwig
QUEUE_FLAG_STOPPEDis entirely unused.Signed-off-by Christoph Hellwig <[email protected]>--- block/blk-mq-debugfs.c | 1 - include/linux/blkdev.h | 2 -- 2 files changed, 3 deletions(-)block/blk-mq-debugfs.c +0
-1@@ -79,7 +79,6 @@ static int queue_pm_only_show(void *data, struct seq_file *m)#define QUEUE_FLAG_NAME (name) [QUEUE_FLAG_##name] = #namestatic const char *const blk_queue_flag_name[] = { -QUEUE_FLAG_NAME (STOPPED ),QUEUE_FLAG_NAME (DYING ),QUEUE_FLAG_NAME (NOMERGES ),QUEUE_FLAG_NAME (SAME_COMP ),include/linux/blkdev.h +0
-0
include/linux/blkdev.h struct request_queue { · line 593
Quoted 5 lines
include/linux/blkdev.h +0
-1@@ -590,7 +590,6 @@ struct request_queue { };/* Keep blk_queue_flag_name[] in sync with the definitions below */ -#define QUEUE_FLAG_STOPPED 0/* queue is stopped */ #define QUEUE_FLAG_DYING 1/* queue being torn down */
I suppose that these should be renumbered, as I think that QUEUE_FLAG_DYING now needs to be index 0 in blk_queue_flag_name[], right?
Quoted 10 lines
include/linux/blkdev.h +0
-1#define QUEUE_FLAG_NOMERGES 3/* disable merge attempts */ #define QUEUE_FLAG_SAME_COMP 4/* complete on same CPU-group */ @@ -610,7 +609,6 @@ struct request_queue {void blk_queue_flag_set (unsigned int flag,struct request_queue *q);void blk_queue_flag_clear (unsigned int flag,struct request_queue *q); -#define blk_queue_stopped (q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags)#define blk_queue_dying (q) test_bit(QUEUE_FLAG_DYING, &(q)->queue_flags)#define blk_queue_init_done (q) test_bit(QUEUE_FLAG_INIT_DONE, &(q)->queue_flags)#define blk_queue_nomerges (q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags)
Quoted 24 lines · John Garry
Quoted 23 lines · Christoph Hellwig
QUEUE_FLAG_STOPPEDis entirely unused.Signed-off-by Christoph Hellwig <[email protected]>---
block/blk-mq-debugfs.c| 1 -
include/linux/blkdev.h| 2 --2 files changed, 3 deletions(-)block/blk-mq-debugfs.c +0
-1@@ -79,7 +79,6 @@ static int queue_pm_only_show(void *data, struct seq_file *m) #define QUEUE_FLAG_NAME(name) [QUEUE_FLAG_##name] = #name static const char *const blk_queue_flag_name[] = { - QUEUE_FLAG_NAME(STOPPED), QUEUE_FLAG_NAME(DYING), QUEUE_FLAG_NAME(NOMERGES), QUEUE_FLAG_NAME(SAME_COMP),include/linux/blkdev.h +0
-1--- a/include/linux/blkdev.h
Quoted 8 lines
include/linux/blkdev.h struct request_queue { · line 592
Quoted 6 lines
+++
b/include/linux/blkdev.hinclude/linux/blkdev.h +0
-1@@ -590,7 +590,6 @@ struct request_queue { }; /* Keep blk_queue_flag_name[] in sync with the definitions below */ -#define QUEUE_FLAG_STOPPED 0/* queue is stopped */ #define QUEUE_FLAG_DYING 1 /* queue being torn down */I suppose that these should be renumbered, as I think that
QUEUE_FLAG_DYINGnow needs to be index 0 in blk_queue_flag_name[], right?
BTW, we seem to be missing an entry for QUEUE_FLAG_HW_WC in blk_queue_flag_name[]
Keeping these in sync needs to be enforced in software.
Maybe have QUEUE_FLAG_ as an enum and have a build bug to enforce array size of blk_queue_flag_name matches the "max" in enum QUEUE_FLAG_ . That's a simple way, but does not enforce correct ordering.
Quoted 13 lines
Quoted 11 lines
include/linux/blkdev.h +0
-1#define QUEUE_FLAG_NOMERGES 3 /* disable merge attempts */ #define QUEUE_FLAG_SAME_COMP 4 /* complete on same CPU-group */@@ -610,7 +609,6 @@ struct request_queue { void blk_queue_flag_set(unsigned int flag, struct request_queue *q); void blk_queue_flag_clear(unsigned int flag, struct request_queue *q); -#define blk_queue_stopped (q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) #define blk_queue_dying(q) test_bit(QUEUE_FLAG_DYING, &(q)->queue_flags) #define blk_queue_init_done(q) test_bit(QUEUE_FLAG_INIT_DONE, &(q)->queue_flags) #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags)
Quoted 4 lines · Christoph Hellwig
QUEUE_FLAG_STOPPEDis entirely unused.Signed-off-by Christoph Hellwig <[email protected]>---
Looks good.
-ck