Commit 1a435111 authored by Omar Sandoval's avatar Omar Sandoval Committed by Jens Axboe

blk-mq-debugfs: clean up flag definitions

Make sure the spelled out flag names match the definition. This also
adds a missing hctx state, BLK_MQ_S_START_ON_RUN, and a missing
cmd_flag, __REQ_NOUNMAP.
Signed-off-by: default avatarOmar Sandoval <osandov@fb.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent bec03d6b
...@@ -63,37 +63,39 @@ static int blk_flags_show(struct seq_file *m, const unsigned long flags, ...@@ -63,37 +63,39 @@ static int blk_flags_show(struct seq_file *m, const unsigned long flags,
return 0; return 0;
} }
#define QUEUE_FLAG_NAME(name) [QUEUE_FLAG_##name] = #name
static const char *const blk_queue_flag_name[] = { static const char *const blk_queue_flag_name[] = {
[QUEUE_FLAG_QUEUED] = "QUEUED", QUEUE_FLAG_NAME(QUEUED),
[QUEUE_FLAG_STOPPED] = "STOPPED", QUEUE_FLAG_NAME(STOPPED),
[QUEUE_FLAG_SYNCFULL] = "SYNCFULL", QUEUE_FLAG_NAME(SYNCFULL),
[QUEUE_FLAG_ASYNCFULL] = "ASYNCFULL", QUEUE_FLAG_NAME(ASYNCFULL),
[QUEUE_FLAG_DYING] = "DYING", QUEUE_FLAG_NAME(DYING),
[QUEUE_FLAG_BYPASS] = "BYPASS", QUEUE_FLAG_NAME(BYPASS),
[QUEUE_FLAG_BIDI] = "BIDI", QUEUE_FLAG_NAME(BIDI),
[QUEUE_FLAG_NOMERGES] = "NOMERGES", QUEUE_FLAG_NAME(NOMERGES),
[QUEUE_FLAG_SAME_COMP] = "SAME_COMP", QUEUE_FLAG_NAME(SAME_COMP),
[QUEUE_FLAG_FAIL_IO] = "FAIL_IO", QUEUE_FLAG_NAME(FAIL_IO),
[QUEUE_FLAG_STACKABLE] = "STACKABLE", QUEUE_FLAG_NAME(STACKABLE),
[QUEUE_FLAG_NONROT] = "NONROT", QUEUE_FLAG_NAME(NONROT),
[QUEUE_FLAG_IO_STAT] = "IO_STAT", QUEUE_FLAG_NAME(IO_STAT),
[QUEUE_FLAG_DISCARD] = "DISCARD", QUEUE_FLAG_NAME(DISCARD),
[QUEUE_FLAG_NOXMERGES] = "NOXMERGES", QUEUE_FLAG_NAME(NOXMERGES),
[QUEUE_FLAG_ADD_RANDOM] = "ADD_RANDOM", QUEUE_FLAG_NAME(ADD_RANDOM),
[QUEUE_FLAG_SECERASE] = "SECERASE", QUEUE_FLAG_NAME(SECERASE),
[QUEUE_FLAG_SAME_FORCE] = "SAME_FORCE", QUEUE_FLAG_NAME(SAME_FORCE),
[QUEUE_FLAG_DEAD] = "DEAD", QUEUE_FLAG_NAME(DEAD),
[QUEUE_FLAG_INIT_DONE] = "INIT_DONE", QUEUE_FLAG_NAME(INIT_DONE),
[QUEUE_FLAG_NO_SG_MERGE] = "NO_SG_MERGE", QUEUE_FLAG_NAME(NO_SG_MERGE),
[QUEUE_FLAG_POLL] = "POLL", QUEUE_FLAG_NAME(POLL),
[QUEUE_FLAG_WC] = "WC", QUEUE_FLAG_NAME(WC),
[QUEUE_FLAG_FUA] = "FUA", QUEUE_FLAG_NAME(FUA),
[QUEUE_FLAG_FLUSH_NQ] = "FLUSH_NQ", QUEUE_FLAG_NAME(FLUSH_NQ),
[QUEUE_FLAG_DAX] = "DAX", QUEUE_FLAG_NAME(DAX),
[QUEUE_FLAG_STATS] = "STATS", QUEUE_FLAG_NAME(STATS),
[QUEUE_FLAG_POLL_STATS] = "POLL_STATS", QUEUE_FLAG_NAME(POLL_STATS),
[QUEUE_FLAG_REGISTERED] = "REGISTERED", QUEUE_FLAG_NAME(REGISTERED),
}; };
#undef QUEUE_FLAG_NAME
static int blk_queue_flags_show(struct seq_file *m, void *v) static int blk_queue_flags_show(struct seq_file *m, void *v)
{ {
...@@ -180,13 +182,16 @@ static const struct file_operations queue_poll_stat_fops = { ...@@ -180,13 +182,16 @@ static const struct file_operations queue_poll_stat_fops = {
.release = single_release, .release = single_release,
}; };
#define HCTX_STATE_NAME(name) [BLK_MQ_S_##name] = #name
static const char *const hctx_state_name[] = { static const char *const hctx_state_name[] = {
[BLK_MQ_S_STOPPED] = "STOPPED", HCTX_STATE_NAME(STOPPED),
[BLK_MQ_S_TAG_ACTIVE] = "TAG_ACTIVE", HCTX_STATE_NAME(TAG_ACTIVE),
[BLK_MQ_S_SCHED_RESTART] = "SCHED_RESTART", HCTX_STATE_NAME(SCHED_RESTART),
[BLK_MQ_S_TAG_WAITING] = "TAG_WAITING", HCTX_STATE_NAME(TAG_WAITING),
HCTX_STATE_NAME(START_ON_RUN),
}; };
#undef HCTX_STATE_NAME
static int hctx_state_show(struct seq_file *m, void *v) static int hctx_state_show(struct seq_file *m, void *v)
{ {
struct blk_mq_hw_ctx *hctx = m->private; struct blk_mq_hw_ctx *hctx = m->private;
...@@ -209,18 +214,22 @@ static const struct file_operations hctx_state_fops = { ...@@ -209,18 +214,22 @@ static const struct file_operations hctx_state_fops = {
.release = single_release, .release = single_release,
}; };
#define BLK_TAG_ALLOC_NAME(name) [BLK_TAG_ALLOC_##name] = #name
static const char *const alloc_policy_name[] = { static const char *const alloc_policy_name[] = {
[BLK_TAG_ALLOC_FIFO] = "fifo", BLK_TAG_ALLOC_NAME(FIFO),
[BLK_TAG_ALLOC_RR] = "rr", BLK_TAG_ALLOC_NAME(RR),
}; };
#undef BLK_TAG_ALLOC_NAME
#define HCTX_FLAG_NAME(name) [ilog2(BLK_MQ_F_##name)] = #name
static const char *const hctx_flag_name[] = { static const char *const hctx_flag_name[] = {
[ilog2(BLK_MQ_F_SHOULD_MERGE)] = "SHOULD_MERGE", HCTX_FLAG_NAME(SHOULD_MERGE),
[ilog2(BLK_MQ_F_TAG_SHARED)] = "TAG_SHARED", HCTX_FLAG_NAME(TAG_SHARED),
[ilog2(BLK_MQ_F_SG_MERGE)] = "SG_MERGE", HCTX_FLAG_NAME(SG_MERGE),
[ilog2(BLK_MQ_F_BLOCKING)] = "BLOCKING", HCTX_FLAG_NAME(BLOCKING),
[ilog2(BLK_MQ_F_NO_SCHED)] = "NO_SCHED", HCTX_FLAG_NAME(NO_SCHED),
}; };
#undef HCTX_FLAG_NAME
static int hctx_flags_show(struct seq_file *m, void *v) static int hctx_flags_show(struct seq_file *m, void *v)
{ {
...@@ -253,60 +262,66 @@ static const struct file_operations hctx_flags_fops = { ...@@ -253,60 +262,66 @@ static const struct file_operations hctx_flags_fops = {
.release = single_release, .release = single_release,
}; };
#define REQ_OP_NAME(name) [REQ_OP_##name] = #name
static const char *const op_name[] = { static const char *const op_name[] = {
[REQ_OP_READ] = "READ", REQ_OP_NAME(READ),
[REQ_OP_WRITE] = "WRITE", REQ_OP_NAME(WRITE),
[REQ_OP_FLUSH] = "FLUSH", REQ_OP_NAME(FLUSH),
[REQ_OP_DISCARD] = "DISCARD", REQ_OP_NAME(DISCARD),
[REQ_OP_ZONE_REPORT] = "ZONE_REPORT", REQ_OP_NAME(ZONE_REPORT),
[REQ_OP_SECURE_ERASE] = "SECURE_ERASE", REQ_OP_NAME(SECURE_ERASE),
[REQ_OP_ZONE_RESET] = "ZONE_RESET", REQ_OP_NAME(ZONE_RESET),
[REQ_OP_WRITE_SAME] = "WRITE_SAME", REQ_OP_NAME(WRITE_SAME),
[REQ_OP_WRITE_ZEROES] = "WRITE_ZEROES", REQ_OP_NAME(WRITE_ZEROES),
[REQ_OP_SCSI_IN] = "SCSI_IN", REQ_OP_NAME(SCSI_IN),
[REQ_OP_SCSI_OUT] = "SCSI_OUT", REQ_OP_NAME(SCSI_OUT),
[REQ_OP_DRV_IN] = "DRV_IN", REQ_OP_NAME(DRV_IN),
[REQ_OP_DRV_OUT] = "DRV_OUT", REQ_OP_NAME(DRV_OUT),
}; };
#undef REQ_OP_NAME
#define CMD_FLAG_NAME(name) [__REQ_##name] = #name
static const char *const cmd_flag_name[] = { static const char *const cmd_flag_name[] = {
[__REQ_FAILFAST_DEV] = "FAILFAST_DEV", CMD_FLAG_NAME(FAILFAST_DEV),
[__REQ_FAILFAST_TRANSPORT] = "FAILFAST_TRANSPORT", CMD_FLAG_NAME(FAILFAST_TRANSPORT),
[__REQ_FAILFAST_DRIVER] = "FAILFAST_DRIVER", CMD_FLAG_NAME(FAILFAST_DRIVER),
[__REQ_SYNC] = "SYNC", CMD_FLAG_NAME(SYNC),
[__REQ_META] = "META", CMD_FLAG_NAME(META),
[__REQ_PRIO] = "PRIO", CMD_FLAG_NAME(PRIO),
[__REQ_NOMERGE] = "NOMERGE", CMD_FLAG_NAME(NOMERGE),
[__REQ_IDLE] = "IDLE", CMD_FLAG_NAME(IDLE),
[__REQ_INTEGRITY] = "INTEGRITY", CMD_FLAG_NAME(INTEGRITY),
[__REQ_FUA] = "FUA", CMD_FLAG_NAME(FUA),
[__REQ_PREFLUSH] = "PREFLUSH", CMD_FLAG_NAME(PREFLUSH),
[__REQ_RAHEAD] = "RAHEAD", CMD_FLAG_NAME(RAHEAD),
[__REQ_BACKGROUND] = "BACKGROUND", CMD_FLAG_NAME(BACKGROUND),
[__REQ_NR_BITS] = "NR_BITS", CMD_FLAG_NAME(NOUNMAP),
}; };
#undef CMD_FLAG_NAME
#define RQF_NAME(name) [ilog2((__force u32)RQF_##name)] = #name
static const char *const rqf_name[] = { static const char *const rqf_name[] = {
[ilog2((__force u32)RQF_SORTED)] = "SORTED", RQF_NAME(SORTED),
[ilog2((__force u32)RQF_STARTED)] = "STARTED", RQF_NAME(STARTED),
[ilog2((__force u32)RQF_QUEUED)] = "QUEUED", RQF_NAME(QUEUED),
[ilog2((__force u32)RQF_SOFTBARRIER)] = "SOFTBARRIER", RQF_NAME(SOFTBARRIER),
[ilog2((__force u32)RQF_FLUSH_SEQ)] = "FLUSH_SEQ", RQF_NAME(FLUSH_SEQ),
[ilog2((__force u32)RQF_MIXED_MERGE)] = "MIXED_MERGE", RQF_NAME(MIXED_MERGE),
[ilog2((__force u32)RQF_MQ_INFLIGHT)] = "MQ_INFLIGHT", RQF_NAME(MQ_INFLIGHT),
[ilog2((__force u32)RQF_DONTPREP)] = "DONTPREP", RQF_NAME(DONTPREP),
[ilog2((__force u32)RQF_PREEMPT)] = "PREEMPT", RQF_NAME(PREEMPT),
[ilog2((__force u32)RQF_COPY_USER)] = "COPY_USER", RQF_NAME(COPY_USER),
[ilog2((__force u32)RQF_FAILED)] = "FAILED", RQF_NAME(FAILED),
[ilog2((__force u32)RQF_QUIET)] = "QUIET", RQF_NAME(QUIET),
[ilog2((__force u32)RQF_ELVPRIV)] = "ELVPRIV", RQF_NAME(ELVPRIV),
[ilog2((__force u32)RQF_IO_STAT)] = "IO_STAT", RQF_NAME(IO_STAT),
[ilog2((__force u32)RQF_ALLOCED)] = "ALLOCED", RQF_NAME(ALLOCED),
[ilog2((__force u32)RQF_PM)] = "PM", RQF_NAME(PM),
[ilog2((__force u32)RQF_HASHED)] = "HASHED", RQF_NAME(HASHED),
[ilog2((__force u32)RQF_STATS)] = "STATS", RQF_NAME(STATS),
[ilog2((__force u32)RQF_SPECIAL_PAYLOAD)] = "SPECIAL_PAYLOAD", RQF_NAME(SPECIAL_PAYLOAD),
}; };
#undef RQF_NAME
static int blk_mq_debugfs_rq_show(struct seq_file *m, void *v) static int blk_mq_debugfs_rq_show(struct seq_file *m, void *v)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment