blk-mq-debugfs.c (f846593391d86289bed6b4834a9717820561d571) blk-mq-debugfs.c (22d538213ec4fa65b08b1edbf610066d8aab7bbb)
1/*
2 * Copyright (C) 2017 Facebook
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public
6 * License v2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,

--- 34 unchanged lines hidden (view full) ---

43 }
44 return 0;
45}
46
47#define QUEUE_FLAG_NAME(name) [QUEUE_FLAG_##name] = #name
48static const char *const blk_queue_flag_name[] = {
49 QUEUE_FLAG_NAME(QUEUED),
50 QUEUE_FLAG_NAME(STOPPED),
1/*
2 * Copyright (C) 2017 Facebook
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public
6 * License v2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,

--- 34 unchanged lines hidden (view full) ---

43 }
44 return 0;
45}
46
47#define QUEUE_FLAG_NAME(name) [QUEUE_FLAG_##name] = #name
48static const char *const blk_queue_flag_name[] = {
49 QUEUE_FLAG_NAME(QUEUED),
50 QUEUE_FLAG_NAME(STOPPED),
51 QUEUE_FLAG_NAME(SYNCFULL),
52 QUEUE_FLAG_NAME(ASYNCFULL),
51 QUEUE_FLAG_NAME(DYING),
52 QUEUE_FLAG_NAME(BYPASS),
53 QUEUE_FLAG_NAME(BIDI),
54 QUEUE_FLAG_NAME(NOMERGES),
55 QUEUE_FLAG_NAME(SAME_COMP),
56 QUEUE_FLAG_NAME(FAIL_IO),
57 QUEUE_FLAG_NAME(STACKABLE),
58 QUEUE_FLAG_NAME(NONROT),

--- 9 unchanged lines hidden (view full) ---

68 QUEUE_FLAG_NAME(POLL),
69 QUEUE_FLAG_NAME(WC),
70 QUEUE_FLAG_NAME(FUA),
71 QUEUE_FLAG_NAME(FLUSH_NQ),
72 QUEUE_FLAG_NAME(DAX),
73 QUEUE_FLAG_NAME(STATS),
74 QUEUE_FLAG_NAME(POLL_STATS),
75 QUEUE_FLAG_NAME(REGISTERED),
53 QUEUE_FLAG_NAME(DYING),
54 QUEUE_FLAG_NAME(BYPASS),
55 QUEUE_FLAG_NAME(BIDI),
56 QUEUE_FLAG_NAME(NOMERGES),
57 QUEUE_FLAG_NAME(SAME_COMP),
58 QUEUE_FLAG_NAME(FAIL_IO),
59 QUEUE_FLAG_NAME(STACKABLE),
60 QUEUE_FLAG_NAME(NONROT),

--- 9 unchanged lines hidden (view full) ---

70 QUEUE_FLAG_NAME(POLL),
71 QUEUE_FLAG_NAME(WC),
72 QUEUE_FLAG_NAME(FUA),
73 QUEUE_FLAG_NAME(FLUSH_NQ),
74 QUEUE_FLAG_NAME(DAX),
75 QUEUE_FLAG_NAME(STATS),
76 QUEUE_FLAG_NAME(POLL_STATS),
77 QUEUE_FLAG_NAME(REGISTERED),
78 QUEUE_FLAG_NAME(SCSI_PASSTHROUGH),
79 QUEUE_FLAG_NAME(QUIESCED),
76};
77#undef QUEUE_FLAG_NAME
78
79static int queue_state_show(void *data, struct seq_file *m)
80{
81 struct request_queue *q = data;
82
83 blk_flags_show(m, q->queue_flags, blk_queue_flag_name,

--- 174 unchanged lines hidden (view full) ---

258 CMD_FLAG_NAME(NOMERGE),
259 CMD_FLAG_NAME(IDLE),
260 CMD_FLAG_NAME(INTEGRITY),
261 CMD_FLAG_NAME(FUA),
262 CMD_FLAG_NAME(PREFLUSH),
263 CMD_FLAG_NAME(RAHEAD),
264 CMD_FLAG_NAME(BACKGROUND),
265 CMD_FLAG_NAME(NOUNMAP),
80};
81#undef QUEUE_FLAG_NAME
82
83static int queue_state_show(void *data, struct seq_file *m)
84{
85 struct request_queue *q = data;
86
87 blk_flags_show(m, q->queue_flags, blk_queue_flag_name,

--- 174 unchanged lines hidden (view full) ---

262 CMD_FLAG_NAME(NOMERGE),
263 CMD_FLAG_NAME(IDLE),
264 CMD_FLAG_NAME(INTEGRITY),
265 CMD_FLAG_NAME(FUA),
266 CMD_FLAG_NAME(PREFLUSH),
267 CMD_FLAG_NAME(RAHEAD),
268 CMD_FLAG_NAME(BACKGROUND),
269 CMD_FLAG_NAME(NOUNMAP),
270 CMD_FLAG_NAME(NOWAIT),
266};
267#undef CMD_FLAG_NAME
268
269#define RQF_NAME(name) [ilog2((__force u32)RQF_##name)] = #name
270static const char *const rqf_name[] = {
271 RQF_NAME(SORTED),
272 RQF_NAME(STARTED),
273 RQF_NAME(QUEUED),

--- 460 unchanged lines hidden (view full) ---

734 const struct blk_mq_debugfs_attr *attr = inode->i_private;
735
736 if (attr->show)
737 return single_release(inode, file);
738 else
739 return seq_release(inode, file);
740}
741
271};
272#undef CMD_FLAG_NAME
273
274#define RQF_NAME(name) [ilog2((__force u32)RQF_##name)] = #name
275static const char *const rqf_name[] = {
276 RQF_NAME(SORTED),
277 RQF_NAME(STARTED),
278 RQF_NAME(QUEUED),

--- 460 unchanged lines hidden (view full) ---

739 const struct blk_mq_debugfs_attr *attr = inode->i_private;
740
741 if (attr->show)
742 return single_release(inode, file);
743 else
744 return seq_release(inode, file);
745}
746
742static const struct file_operations blk_mq_debugfs_fops = {
747const struct file_operations blk_mq_debugfs_fops = {
743 .open = blk_mq_debugfs_open,
744 .read = seq_read,
745 .write = blk_mq_debugfs_write,
746 .llseek = seq_lseek,
747 .release = blk_mq_debugfs_release,
748};
749
750static const struct blk_mq_debugfs_attr blk_mq_debugfs_queue_attrs[] = {

--- 226 unchanged lines hidden ---
748 .open = blk_mq_debugfs_open,
749 .read = seq_read,
750 .write = blk_mq_debugfs_write,
751 .llseek = seq_lseek,
752 .release = blk_mq_debugfs_release,
753};
754
755static const struct blk_mq_debugfs_attr blk_mq_debugfs_queue_attrs[] = {

--- 226 unchanged lines hidden ---