aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-rq-qos.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fb.com>2018-07-03 11:14:59 -0400
committerJens Axboe <axboe@kernel.dk>2018-07-09 11:07:54 -0400
commitc1c80384c8f47021a01a0cc42894a06bed2b801b (patch)
treee3fb3b3ddf6c58eea32d49989875ca39c0ba382c /block/blk-rq-qos.c
parenta79050434b45959f397042080fd1d70ffa9bd9df (diff)
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 @@
1#include "blk-rq-qos.h" 1#include "blk-rq-qos.h"
2 2
3#include "blk-wbt.h"
4
5/* 3/*
6 * Increment 'v', if 'v' is below 'below'. Returns true if we succeeded, 4 * Increment 'v', if 'v' is below 'below'. Returns true if we succeeded,
7 * false if 'v' + 1 would be bigger than 'below'. 5 * 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)
29 return atomic_inc_below(&rq_wait->inflight, limit); 27 return atomic_inc_below(&rq_wait->inflight, limit);
30} 28}
31 29
32void rq_qos_cleanup(struct request_queue *q, enum wbt_flags wb_acct) 30void rq_qos_cleanup(struct request_queue *q, struct bio *bio)
33{ 31{
34 struct rq_qos *rqos; 32 struct rq_qos *rqos;
35 33
36 for (rqos = q->rq_qos; rqos; rqos = rqos->next) { 34 for (rqos = q->rq_qos; rqos; rqos = rqos->next) {
37 if (rqos->ops->cleanup) 35 if (rqos->ops->cleanup)
38 rqos->ops->cleanup(rqos, wb_acct); 36 rqos->ops->cleanup(rqos, bio);
39 } 37 }
40} 38}
41 39
@@ -69,17 +67,25 @@ void rq_qos_requeue(struct request_queue *q, struct request *rq)
69 } 67 }
70} 68}
71 69
72enum wbt_flags rq_qos_throttle(struct request_queue *q, struct bio *bio, 70void rq_qos_throttle(struct request_queue *q, struct bio *bio,
73 spinlock_t *lock) 71 spinlock_t *lock)
74{ 72{
75 struct rq_qos *rqos; 73 struct rq_qos *rqos;
76 enum wbt_flags flags = 0;
77 74
78 for(rqos = q->rq_qos; rqos; rqos = rqos->next) { 75 for(rqos = q->rq_qos; rqos; rqos = rqos->next) {
79 if (rqos->ops->throttle) 76 if (rqos->ops->throttle)
80 flags |= rqos->ops->throttle(rqos, bio, lock); 77 rqos->ops->throttle(rqos, bio, lock);
78 }
79}
80
81void rq_qos_track(struct request_queue *q, struct request *rq, struct bio *bio)
82{
83 struct rq_qos *rqos;
84
85 for(rqos = q->rq_qos; rqos; rqos = rqos->next) {
86 if (rqos->ops->track)
87 rqos->ops->track(rqos, rq, bio);
81 } 88 }
82 return flags;
83} 89}
84 90
85/* 91/*