Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef INT_BLK_MQ_DEBUGFS_H
0003 #define INT_BLK_MQ_DEBUGFS_H
0004 
0005 #ifdef CONFIG_BLK_DEBUG_FS
0006 
0007 #include <linux/seq_file.h>
0008 
0009 struct blk_mq_hw_ctx;
0010 
0011 struct blk_mq_debugfs_attr {
0012     const char *name;
0013     umode_t mode;
0014     int (*show)(void *, struct seq_file *);
0015     ssize_t (*write)(void *, const char __user *, size_t, loff_t *);
0016     /* Set either .show or .seq_ops. */
0017     const struct seq_operations *seq_ops;
0018 };
0019 
0020 int __blk_mq_debugfs_rq_show(struct seq_file *m, struct request *rq);
0021 int blk_mq_debugfs_rq_show(struct seq_file *m, void *v);
0022 
0023 void blk_mq_debugfs_register(struct request_queue *q);
0024 void blk_mq_debugfs_register_hctx(struct request_queue *q,
0025                   struct blk_mq_hw_ctx *hctx);
0026 void blk_mq_debugfs_unregister_hctx(struct blk_mq_hw_ctx *hctx);
0027 void blk_mq_debugfs_register_hctxs(struct request_queue *q);
0028 void blk_mq_debugfs_unregister_hctxs(struct request_queue *q);
0029 
0030 void blk_mq_debugfs_register_sched(struct request_queue *q);
0031 void blk_mq_debugfs_unregister_sched(struct request_queue *q);
0032 void blk_mq_debugfs_register_sched_hctx(struct request_queue *q,
0033                        struct blk_mq_hw_ctx *hctx);
0034 void blk_mq_debugfs_unregister_sched_hctx(struct blk_mq_hw_ctx *hctx);
0035 
0036 void blk_mq_debugfs_register_rqos(struct rq_qos *rqos);
0037 void blk_mq_debugfs_unregister_rqos(struct rq_qos *rqos);
0038 #else
0039 static inline void blk_mq_debugfs_register(struct request_queue *q)
0040 {
0041 }
0042 
0043 static inline void blk_mq_debugfs_register_hctx(struct request_queue *q,
0044                         struct blk_mq_hw_ctx *hctx)
0045 {
0046 }
0047 
0048 static inline void blk_mq_debugfs_unregister_hctx(struct blk_mq_hw_ctx *hctx)
0049 {
0050 }
0051 
0052 static inline void blk_mq_debugfs_register_hctxs(struct request_queue *q)
0053 {
0054 }
0055 
0056 static inline void blk_mq_debugfs_unregister_hctxs(struct request_queue *q)
0057 {
0058 }
0059 
0060 static inline void blk_mq_debugfs_register_sched(struct request_queue *q)
0061 {
0062 }
0063 
0064 static inline void blk_mq_debugfs_unregister_sched(struct request_queue *q)
0065 {
0066 }
0067 
0068 static inline void blk_mq_debugfs_register_sched_hctx(struct request_queue *q,
0069                               struct blk_mq_hw_ctx *hctx)
0070 {
0071 }
0072 
0073 static inline void blk_mq_debugfs_unregister_sched_hctx(struct blk_mq_hw_ctx *hctx)
0074 {
0075 }
0076 
0077 static inline void blk_mq_debugfs_register_rqos(struct rq_qos *rqos)
0078 {
0079 }
0080 
0081 static inline void blk_mq_debugfs_unregister_rqos(struct rq_qos *rqos)
0082 {
0083 }
0084 #endif
0085 
0086 #ifdef CONFIG_BLK_DEBUG_FS_ZONED
0087 int queue_zone_wlock_show(void *data, struct seq_file *m);
0088 #else
0089 static inline int queue_zone_wlock_show(void *data, struct seq_file *m)
0090 {
0091     return 0;
0092 }
0093 #endif
0094 
0095 #endif