blob: dd3bbfe74f46a7b90063de3d3e5cfc3e06f007b3 [file] [log] [blame]
Omar Sandovald173a252017-05-04 00:31:30 -07001#ifndef INT_BLK_MQ_DEBUGFS_H
2#define INT_BLK_MQ_DEBUGFS_H
3
4#ifdef CONFIG_BLK_DEBUG_FS
Omar Sandovald332ce02017-05-04 08:24:40 -06005
6#include <linux/seq_file.h>
7
8struct blk_mq_debugfs_attr {
9 const char *name;
10 umode_t mode;
11 int (*show)(void *, struct seq_file *);
12 ssize_t (*write)(void *, const char __user *, size_t, loff_t *);
13 /* Set either .show or .seq_ops. */
14 const struct seq_operations *seq_ops;
15};
16
Omar Sandoval16b738f2017-05-04 00:31:33 -070017int blk_mq_debugfs_rq_show(struct seq_file *m, void *v);
18
Omar Sandovald173a252017-05-04 00:31:30 -070019int blk_mq_debugfs_register(struct request_queue *q);
20void blk_mq_debugfs_unregister(struct request_queue *q);
Omar Sandoval9c1051a2017-05-04 08:17:21 -060021int blk_mq_debugfs_register_hctx(struct request_queue *q,
22 struct blk_mq_hw_ctx *hctx);
23void blk_mq_debugfs_unregister_hctx(struct blk_mq_hw_ctx *hctx);
24int blk_mq_debugfs_register_hctxs(struct request_queue *q);
25void blk_mq_debugfs_unregister_hctxs(struct request_queue *q);
Omar Sandovald332ce02017-05-04 08:24:40 -060026
27int blk_mq_debugfs_register_sched(struct request_queue *q);
28void blk_mq_debugfs_unregister_sched(struct request_queue *q);
29int blk_mq_debugfs_register_sched_hctx(struct request_queue *q,
30 struct blk_mq_hw_ctx *hctx);
31void blk_mq_debugfs_unregister_sched_hctx(struct blk_mq_hw_ctx *hctx);
Omar Sandovald173a252017-05-04 00:31:30 -070032#else
33static inline int blk_mq_debugfs_register(struct request_queue *q)
34{
35 return 0;
36}
37
38static inline void blk_mq_debugfs_unregister(struct request_queue *q)
39{
40}
41
Omar Sandoval9c1051a2017-05-04 08:17:21 -060042static inline int blk_mq_debugfs_register_hctx(struct request_queue *q,
43 struct blk_mq_hw_ctx *hctx)
Omar Sandovald173a252017-05-04 00:31:30 -070044{
45 return 0;
46}
47
Omar Sandoval9c1051a2017-05-04 08:17:21 -060048static inline void blk_mq_debugfs_unregister_hctx(struct blk_mq_hw_ctx *hctx)
49{
50}
51
52static inline int blk_mq_debugfs_register_hctxs(struct request_queue *q)
53{
54 return 0;
55}
56
57static inline void blk_mq_debugfs_unregister_hctxs(struct request_queue *q)
Omar Sandovald173a252017-05-04 00:31:30 -070058{
59}
Omar Sandovald332ce02017-05-04 08:24:40 -060060
61static inline int blk_mq_debugfs_register_sched(struct request_queue *q)
62{
63 return 0;
64}
65
66static inline void blk_mq_debugfs_unregister_sched(struct request_queue *q)
67{
68}
69
70static inline int blk_mq_debugfs_register_sched_hctx(struct request_queue *q,
71 struct blk_mq_hw_ctx *hctx)
72{
73 return 0;
74}
75
76static inline void blk_mq_debugfs_unregister_sched_hctx(struct blk_mq_hw_ctx *hctx)
77{
78}
Omar Sandovald173a252017-05-04 00:31:30 -070079#endif
80
81#endif