summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2018-08-26 10:09:06 -0600
committerJens Axboe <axboe@kernel.dk>2018-08-27 11:27:24 -0600
commit061a5427530633de93ace4ef001b99961984af62 (patch)
tree880d280de6a3e32341f63d8abc03fede9a59d022 /block
parentb8dcdab36f5394a09b66516057cccf61a81a3877 (diff)
downloadlinux-061a5427530633de93ace4ef001b99961984af62.tar.gz
linux-061a5427530633de93ace4ef001b99961984af62.tar.bz2
linux-061a5427530633de93ace4ef001b99961984af62.zip
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>
Diffstat (limited to 'block')
-rw-r--r--block/blk-wbt.c21
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)
}
}
-static void __wbt_done(struct rq_qos *rqos, enum wbt_flags wb_acct)
+static void wbt_rqw_done(struct rq_wb *rwb, struct rq_wait *rqw,
+ enum wbt_flags wb_acct)
{
- struct rq_wb *rwb = RQWB(rqos);
- struct rq_wait *rqw;
int inflight, limit;
- if (!(wb_acct & WBT_TRACKED))
- return;
-
- rqw = get_rq_wait(rwb, wb_acct);
inflight = atomic_dec_return(&rqw->inflight);
/*
@@ -170,6 +165,18 @@ static void __wbt_done(struct rq_qos *rqos, enum wbt_flags wb_acct)
}
}
+static void __wbt_done(struct rq_qos *rqos, enum wbt_flags wb_acct)
+{
+ struct rq_wb *rwb = RQWB(rqos);
+ struct rq_wait *rqw;
+
+ if (!(wb_acct & WBT_TRACKED))
+ return;
+
+ rqw = get_rq_wait(rwb, wb_acct);
+ wbt_rqw_done(rwb, rqw, wb_acct);
+}
+
/*
* Called on completion of a request. Note that it's also called when
* a request is merged, when the request gets freed.