diff options
author | Jens Axboe <axboe@kernel.dk> | 2018-08-26 12:09:06 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-08-27 13:27:24 -0400 |
commit | 061a5427530633de93ace4ef001b99961984af62 (patch) | |
tree | 880d280de6a3e32341f63d8abc03fede9a59d022 | |
parent | b8dcdab36f5394a09b66516057cccf61a81a3877 (diff) |
blk-wbt: abstract out end IO completion handler
Prep patch for calling the handler from a different context,
no functional changes in this patch.
Tested-by: Agarwal, Anchal <anchalag@amazon.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | block/blk-wbt.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/block/blk-wbt.c b/block/blk-wbt.c index 84507d3e9a98..4575b4650370 100644 --- a/block/blk-wbt.c +++ b/block/blk-wbt.c | |||
@@ -123,16 +123,11 @@ static void rwb_wake_all(struct rq_wb *rwb) | |||
123 | } | 123 | } |
124 | } | 124 | } |
125 | 125 | ||
126 | static void __wbt_done(struct rq_qos *rqos, enum wbt_flags wb_acct) | 126 | static void wbt_rqw_done(struct rq_wb *rwb, struct rq_wait *rqw, |
127 | enum wbt_flags wb_acct) | ||
127 | { | 128 | { |
128 | struct rq_wb *rwb = RQWB(rqos); | ||
129 | struct rq_wait *rqw; | ||
130 | int inflight, limit; | 129 | int inflight, limit; |
131 | 130 | ||
132 | if (!(wb_acct & WBT_TRACKED)) | ||
133 | return; | ||
134 | |||
135 | rqw = get_rq_wait(rwb, wb_acct); | ||
136 | inflight = atomic_dec_return(&rqw->inflight); | 131 | inflight = atomic_dec_return(&rqw->inflight); |
137 | 132 | ||
138 | /* | 133 | /* |
@@ -170,6 +165,18 @@ static void __wbt_done(struct rq_qos *rqos, enum wbt_flags wb_acct) | |||
170 | } | 165 | } |
171 | } | 166 | } |
172 | 167 | ||
168 | static void __wbt_done(struct rq_qos *rqos, enum wbt_flags wb_acct) | ||
169 | { | ||
170 | struct rq_wb *rwb = RQWB(rqos); | ||
171 | struct rq_wait *rqw; | ||
172 | |||
173 | if (!(wb_acct & WBT_TRACKED)) | ||
174 | return; | ||
175 | |||
176 | rqw = get_rq_wait(rwb, wb_acct); | ||
177 | wbt_rqw_done(rwb, rqw, wb_acct); | ||
178 | } | ||
179 | |||
173 | /* | 180 | /* |
174 | * Called on completion of a request. Note that it's also called when | 181 | * Called on completion of a request. Note that it's also called when |
175 | * a request is merged, when the request gets freed. | 182 | * a request is merged, when the request gets freed. |