#ifndef RQ_QOS_H
#define RQ_QOS_H
#include <linux/kernel.h>
#include <linux/blkdev.h>
#include <linux/blk_types.h>
#include <linux/atomic.h>
#include <linux/wait.h>
#include <linux/blk-mq.h>
#include "blk-mq-debugfs.h"
struct blk_mq_debugfs_attr;
enum rq_qos_id { … };
struct rq_wait { … };
struct rq_qos { … };
struct rq_qos_ops { … };
struct rq_depth { … };
static inline struct rq_qos *rq_qos_id(struct request_queue *q,
enum rq_qos_id id)
{ … }
static inline struct rq_qos *wbt_rq_qos(struct request_queue *q)
{ … }
static inline struct rq_qos *iolat_rq_qos(struct request_queue *q)
{ … }
static inline void rq_wait_init(struct rq_wait *rq_wait)
{ … }
int rq_qos_add(struct rq_qos *rqos, struct gendisk *disk, enum rq_qos_id id,
const struct rq_qos_ops *ops);
void rq_qos_del(struct rq_qos *rqos);
acquire_inflight_cb_t;
cleanup_cb_t;
void rq_qos_wait(struct rq_wait *rqw, void *private_data,
acquire_inflight_cb_t *acquire_inflight_cb,
cleanup_cb_t *cleanup_cb);
bool rq_wait_inc_below(struct rq_wait *rq_wait, unsigned int limit);
bool rq_depth_scale_up(struct rq_depth *rqd);
bool rq_depth_scale_down(struct rq_depth *rqd, bool hard_throttle);
bool rq_depth_calc_max_depth(struct rq_depth *rqd);
void __rq_qos_cleanup(struct rq_qos *rqos, struct bio *bio);
void __rq_qos_done(struct rq_qos *rqos, struct request *rq);
void __rq_qos_issue(struct rq_qos *rqos, struct request *rq);
void __rq_qos_requeue(struct rq_qos *rqos, struct request *rq);
void __rq_qos_throttle(struct rq_qos *rqos, struct bio *bio);
void __rq_qos_track(struct rq_qos *rqos, struct request *rq, struct bio *bio);
void __rq_qos_merge(struct rq_qos *rqos, struct request *rq, struct bio *bio);
void __rq_qos_done_bio(struct rq_qos *rqos, struct bio *bio);
void __rq_qos_queue_depth_changed(struct rq_qos *rqos);
static inline void rq_qos_cleanup(struct request_queue *q, struct bio *bio)
{ … }
static inline void rq_qos_done(struct request_queue *q, struct request *rq)
{ … }
static inline void rq_qos_issue(struct request_queue *q, struct request *rq)
{ … }
static inline void rq_qos_requeue(struct request_queue *q, struct request *rq)
{ … }
static inline void rq_qos_done_bio(struct bio *bio)
{ … }
static inline void rq_qos_throttle(struct request_queue *q, struct bio *bio)
{ … }
static inline void rq_qos_track(struct request_queue *q, struct request *rq,
struct bio *bio)
{ … }
static inline void rq_qos_merge(struct request_queue *q, struct request *rq,
struct bio *bio)
{ … }
static inline void rq_qos_queue_depth_changed(struct request_queue *q)
{ … }
void rq_qos_exit(struct request_queue *);
#endif