diff mbox series

blk-mq-debugfs: update blk_queue_flag_name[] accordingly for new flags

Message ID 20200427133445.26215-1-houtao1@huawei.com (mailing list archive)
State New, archived
Headers show
Series blk-mq-debugfs: update blk_queue_flag_name[] accordingly for new flags | expand

Commit Message

Hou Tao April 27, 2020, 1:34 p.m. UTC
Else there may be magic numbers in /sys/kernel/debug/block/*/state.

Signed-off-by: Hou Tao <houtao1@huawei.com>
---
 block/blk-mq-debugfs.c | 3 +++
 include/linux/blkdev.h | 1 +
 2 files changed, 4 insertions(+)

Comments

Bart Van Assche April 27, 2020, 5:30 p.m. UTC | #1
On 2020-04-27 06:34, Hou Tao wrote:
> Else there may be magic numbers in /sys/kernel/debug/block/*/state.
> 
> Signed-off-by: Hou Tao <houtao1@huawei.com>
> ---
>  block/blk-mq-debugfs.c | 3 +++
>  include/linux/blkdev.h | 1 +
>  2 files changed, 4 insertions(+)
> 
> diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
> index 7a79db81a63f..49fdbc8a025f 100644
> --- a/block/blk-mq-debugfs.c
> +++ b/block/blk-mq-debugfs.c
> @@ -125,6 +125,9 @@ static const char *const blk_queue_flag_name[] = {
>  	QUEUE_FLAG_NAME(REGISTERED),
>  	QUEUE_FLAG_NAME(SCSI_PASSTHROUGH),
>  	QUEUE_FLAG_NAME(QUIESCED),
> +	QUEUE_FLAG_NAME(PCI_P2PDMA),
> +	QUEUE_FLAG_NAME(ZONE_RESETALL),
> +	QUEUE_FLAG_NAME(RQ_ALLOC_TIME),
>  };
>  #undef QUEUE_FLAG_NAME
>  
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index 32868fbedc9e..d56ef0def78b 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -585,6 +585,7 @@ struct request_queue {
>  	u64			write_hints[BLK_MAX_WRITE_HINTS];
>  };
>  
> +/* Need to update blk_queue_flag_name[] accordingly */
>  #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 */

Changing "Need to update blk_queue_flag_name[] accordingly" into "Keep
blk_queue_flag_name[] in sync with the definitions below" probably would
be more clear. Anyway:

Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Jens Axboe June 29, 2020, 1:45 p.m. UTC | #2
On 4/27/20 7:34 AM, Hou Tao wrote:
> Else there may be magic numbers in /sys/kernel/debug/block/*/state.

Applied, thanks.
diff mbox series

Patch

diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
index 7a79db81a63f..49fdbc8a025f 100644
--- a/block/blk-mq-debugfs.c
+++ b/block/blk-mq-debugfs.c
@@ -125,6 +125,9 @@  static const char *const blk_queue_flag_name[] = {
 	QUEUE_FLAG_NAME(REGISTERED),
 	QUEUE_FLAG_NAME(SCSI_PASSTHROUGH),
 	QUEUE_FLAG_NAME(QUIESCED),
+	QUEUE_FLAG_NAME(PCI_P2PDMA),
+	QUEUE_FLAG_NAME(ZONE_RESETALL),
+	QUEUE_FLAG_NAME(RQ_ALLOC_TIME),
 };
 #undef QUEUE_FLAG_NAME
 
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 32868fbedc9e..d56ef0def78b 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -585,6 +585,7 @@  struct request_queue {
 	u64			write_hints[BLK_MAX_WRITE_HINTS];
 };
 
+/* Need to update blk_queue_flag_name[] accordingly */
 #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 */