summaryrefslogtreecommitdiff
path: root/block/blk-rq-qos.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fb.com>2018-07-03 18:14:59 +0300
committerJens Axboe <axboe@kernel.dk>2018-07-09 18:07:54 +0300
commitc1c80384c8f47021a01a0cc42894a06bed2b801b (patch)
treee3fb3b3ddf6c58eea32d49989875ca39c0ba382c /block/blk-rq-qos.c
parenta79050434b45959f397042080fd1d70ffa9bd9df (diff)
downloadlinux-c1c80384c8f47021a01a0cc42894a06bed2b801b.tar.xz
block: remove external dependency on wbt_flags
We don't really need to save this stuff in the core block code, we can just pass the bio back into the helpers later on to derive the same flags and update the rq->wbt_flags appropriately. Signed-off-by: Josef Bacik <jbacik@fb.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-rq-qos.c')
-rw-r--r--block/blk-rq-qos.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/block/blk-rq-qos.c b/block/blk-rq-qos.c
index d2f2af8aa10c..b7b02e04f64f 100644
--- a/block/blk-rq-qos.c
+++ b/block/blk-rq-qos.c
@@ -1,7 +1,5 @@
#include "blk-rq-qos.h"
-#include "blk-wbt.h"
-
/*
* Increment 'v', if 'v' is below 'below'. Returns true if we succeeded,
* false if 'v' + 1 would be bigger than 'below'.
@@ -29,13 +27,13 @@ bool rq_wait_inc_below(struct rq_wait *rq_wait, int limit)
return atomic_inc_below(&rq_wait->inflight, limit);
}
-void rq_qos_cleanup(struct request_queue *q, enum wbt_flags wb_acct)
+void rq_qos_cleanup(struct request_queue *q, struct bio *bio)
{
struct rq_qos *rqos;
for (rqos = q->rq_qos; rqos; rqos = rqos->next) {
if (rqos->ops->cleanup)
- rqos->ops->cleanup(rqos, wb_acct);
+ rqos->ops->cleanup(rqos, bio);
}
}
@@ -69,17 +67,25 @@ void rq_qos_requeue(struct request_queue *q, struct request *rq)
}
}
-enum wbt_flags rq_qos_throttle(struct request_queue *q, struct bio *bio,
- spinlock_t *lock)
+void rq_qos_throttle(struct request_queue *q, struct bio *bio,
+ spinlock_t *lock)
{
struct rq_qos *rqos;
- enum wbt_flags flags = 0;
for(rqos = q->rq_qos; rqos; rqos = rqos->next) {
if (rqos->ops->throttle)
- flags |= rqos->ops->throttle(rqos, bio, lock);
+ rqos->ops->throttle(rqos, bio, lock);
+ }
+}
+
+void rq_qos_track(struct request_queue *q, struct request *rq, struct bio *bio)
+{
+ struct rq_qos *rqos;
+
+ for(rqos = q->rq_qos; rqos; rqos = rqos->next) {
+ if (rqos->ops->track)
+ rqos->ops->track(rqos, rq, bio);
}
- return flags;
}
/*