blob: a5ac21c81ea38ec7f62cca6ca781af341dcbf61f [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 Sandovald173a252017-05-04 00:31:30 -070017int blk_mq_debugfs_register(struct request_queue *q);
18void blk_mq_debugfs_unregister(struct request_queue *q);
Omar Sandoval9c1051a2017-05-04 08:17:21 -060019int blk_mq_debugfs_register_hctx(struct request_queue *q,
20 struct blk_mq_hw_ctx *hctx);
21void blk_mq_debugfs_unregister_hctx(struct blk_mq_hw_ctx *hctx);
22int blk_mq_debugfs_register_hctxs(struct request_queue *q);
23void blk_mq_debugfs_unregister_hctxs(struct request_queue *q);
Omar Sandovald332ce02017-05-04 08:24:40 -060024
25int blk_mq_debugfs_register_sched(struct request_queue *q);
26void blk_mq_debugfs_unregister_sched(struct request_queue *q);
27int blk_mq_debugfs_register_sched_hctx(struct request_queue *q,
28 struct blk_mq_hw_ctx *hctx);
29void blk_mq_debugfs_unregister_sched_hctx(struct blk_mq_hw_ctx *hctx);
Omar Sandovald173a252017-05-04 00:31:30 -070030#else
31static inline int blk_mq_debugfs_register(struct request_queue *q)
32{
33 return 0;
34}
35
36static inline void blk_mq_debugfs_unregister(struct request_queue *q)
37{
38}
39
Omar Sandoval9c1051a2017-05-04 08:17:21 -060040static inline int blk_mq_debugfs_register_hctx(struct request_queue *q,
41 struct blk_mq_hw_ctx *hctx)
Omar Sandovald173a252017-05-04 00:31:30 -070042{
43 return 0;
44}
45
Omar Sandoval9c1051a2017-05-04 08:17:21 -060046static inline void blk_mq_debugfs_unregister_hctx(struct blk_mq_hw_ctx *hctx)
47{
48}
49
50static inline int blk_mq_debugfs_register_hctxs(struct request_queue *q)
51{
52 return 0;
53}
54
55static inline void blk_mq_debugfs_unregister_hctxs(struct request_queue *q)
Omar Sandovald173a252017-05-04 00:31:30 -070056{
57}
Omar Sandovald332ce02017-05-04 08:24:40 -060058
59static inline int blk_mq_debugfs_register_sched(struct request_queue *q)
60{
61 return 0;
62}
63
64static inline void blk_mq_debugfs_unregister_sched(struct request_queue *q)
65{
66}
67
68static inline int blk_mq_debugfs_register_sched_hctx(struct request_queue *q,
69 struct blk_mq_hw_ctx *hctx)
70{
71 return 0;
72}
73
74static inline void blk_mq_debugfs_unregister_sched_hctx(struct blk_mq_hw_ctx *hctx)
75{
76}
Omar Sandovald173a252017-05-04 00:31:30 -070077#endif
78
79#endif