Omar Sandoval | d173a25 | 2017-05-04 00:31:30 -0700 | [diff] [blame] | 1 | #ifndef INT_BLK_MQ_DEBUGFS_H |
| 2 | #define INT_BLK_MQ_DEBUGFS_H |
| 3 | |
| 4 | #ifdef CONFIG_BLK_DEBUG_FS |
Omar Sandoval | d332ce0 | 2017-05-04 08:24:40 -0600 | [diff] [blame^] | 5 | |
| 6 | #include <linux/seq_file.h> |
| 7 | |
| 8 | struct 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 Sandoval | d173a25 | 2017-05-04 00:31:30 -0700 | [diff] [blame] | 17 | int blk_mq_debugfs_register(struct request_queue *q); |
| 18 | void blk_mq_debugfs_unregister(struct request_queue *q); |
Omar Sandoval | 9c1051a | 2017-05-04 08:17:21 -0600 | [diff] [blame] | 19 | int blk_mq_debugfs_register_hctx(struct request_queue *q, |
| 20 | struct blk_mq_hw_ctx *hctx); |
| 21 | void blk_mq_debugfs_unregister_hctx(struct blk_mq_hw_ctx *hctx); |
| 22 | int blk_mq_debugfs_register_hctxs(struct request_queue *q); |
| 23 | void blk_mq_debugfs_unregister_hctxs(struct request_queue *q); |
Omar Sandoval | d332ce0 | 2017-05-04 08:24:40 -0600 | [diff] [blame^] | 24 | |
| 25 | int blk_mq_debugfs_register_sched(struct request_queue *q); |
| 26 | void blk_mq_debugfs_unregister_sched(struct request_queue *q); |
| 27 | int blk_mq_debugfs_register_sched_hctx(struct request_queue *q, |
| 28 | struct blk_mq_hw_ctx *hctx); |
| 29 | void blk_mq_debugfs_unregister_sched_hctx(struct blk_mq_hw_ctx *hctx); |
Omar Sandoval | d173a25 | 2017-05-04 00:31:30 -0700 | [diff] [blame] | 30 | #else |
| 31 | static inline int blk_mq_debugfs_register(struct request_queue *q) |
| 32 | { |
| 33 | return 0; |
| 34 | } |
| 35 | |
| 36 | static inline void blk_mq_debugfs_unregister(struct request_queue *q) |
| 37 | { |
| 38 | } |
| 39 | |
Omar Sandoval | 9c1051a | 2017-05-04 08:17:21 -0600 | [diff] [blame] | 40 | static inline int blk_mq_debugfs_register_hctx(struct request_queue *q, |
| 41 | struct blk_mq_hw_ctx *hctx) |
Omar Sandoval | d173a25 | 2017-05-04 00:31:30 -0700 | [diff] [blame] | 42 | { |
| 43 | return 0; |
| 44 | } |
| 45 | |
Omar Sandoval | 9c1051a | 2017-05-04 08:17:21 -0600 | [diff] [blame] | 46 | static inline void blk_mq_debugfs_unregister_hctx(struct blk_mq_hw_ctx *hctx) |
| 47 | { |
| 48 | } |
| 49 | |
| 50 | static inline int blk_mq_debugfs_register_hctxs(struct request_queue *q) |
| 51 | { |
| 52 | return 0; |
| 53 | } |
| 54 | |
| 55 | static inline void blk_mq_debugfs_unregister_hctxs(struct request_queue *q) |
Omar Sandoval | d173a25 | 2017-05-04 00:31:30 -0700 | [diff] [blame] | 56 | { |
| 57 | } |
Omar Sandoval | d332ce0 | 2017-05-04 08:24:40 -0600 | [diff] [blame^] | 58 | |
| 59 | static inline int blk_mq_debugfs_register_sched(struct request_queue *q) |
| 60 | { |
| 61 | return 0; |
| 62 | } |
| 63 | |
| 64 | static inline void blk_mq_debugfs_unregister_sched(struct request_queue *q) |
| 65 | { |
| 66 | } |
| 67 | |
| 68 | static 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 | |
| 74 | static inline void blk_mq_debugfs_unregister_sched_hctx(struct blk_mq_hw_ctx *hctx) |
| 75 | { |
| 76 | } |
Omar Sandoval | d173a25 | 2017-05-04 00:31:30 -0700 | [diff] [blame] | 77 | #endif |
| 78 | |
| 79 | #endif |