linux/block/blk-rq-qos.c

// SPDX-License-Identifier: GPL-2.0

#include "blk-rq-qos.h"

/*
 * Increment 'v', if 'v' is below 'below'. Returns true if we succeeded,
 * false if 'v' + 1 would be bigger than 'below'.
 */
static bool atomic_inc_below(atomic_t *v, unsigned int below)
{}

bool rq_wait_inc_below(struct rq_wait *rq_wait, unsigned int limit)
{}

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)
{}

/*
 * Return true, if we can't increase the depth further by scaling
 */
bool rq_depth_calc_max_depth(struct rq_depth *rqd)
{}

/* Returns true on success and false if scaling up wasn't possible */
bool rq_depth_scale_up(struct rq_depth *rqd)
{}

/*
 * Scale rwb down. If 'hard_throttle' is set, do it quicker, since we
 * had a latency violation. Returns true on success and returns false if
 * scaling down wasn't possible.
 */
bool rq_depth_scale_down(struct rq_depth *rqd, bool hard_throttle)
{}

struct rq_qos_wait_data {};

static int rq_qos_wake_function(struct wait_queue_entry *curr,
				unsigned int mode, int wake_flags, void *key)
{}

/**
 * rq_qos_wait - throttle on a rqw if we need to
 * @rqw: rqw to throttle on
 * @private_data: caller provided specific data
 * @acquire_inflight_cb: inc the rqw->inflight counter if we can
 * @cleanup_cb: the callback to cleanup in case we race with a waker
 *
 * This provides a uniform place for the rq_qos users to do their throttling.
 * Since you can end up with a lot of things sleeping at once, this manages the
 * waking up based on the resources available.  The acquire_inflight_cb should
 * inc the rqw->inflight if we have the ability to do so, or return false if not
 * and then we will sleep until the room becomes available.
 *
 * cleanup_cb is in case that we race with a waker and need to cleanup the
 * inflight count accordingly.
 */
void rq_qos_wait(struct rq_wait *rqw, void *private_data,
		 acquire_inflight_cb_t *acquire_inflight_cb,
		 cleanup_cb_t *cleanup_cb)
{}

void rq_qos_exit(struct request_queue *q)
{}

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)
{}