Skip to content

Commit 061a542

Browse files
committed
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 <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent b8dcdab commit 061a542

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

block/blk-wbt.c

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,11 @@ static void rwb_wake_all(struct rq_wb *rwb)
123123
}
124124
}
125125

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)
127128
{
128-
struct rq_wb *rwb = RQWB(rqos);
129-
struct rq_wait *rqw;
130129
int inflight, limit;
131130

132-
if (!(wb_acct & WBT_TRACKED))
133-
return;
134-
135-
rqw = get_rq_wait(rwb, wb_acct);
136131
inflight = atomic_dec_return(&rqw->inflight);
137132

138133
/*
@@ -170,6 +165,18 @@ static void __wbt_done(struct rq_qos *rqos, enum wbt_flags wb_acct)
170165
}
171166
}
172167

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+
173180
/*
174181
* Called on completion of a request. Note that it's also called when
175182
* a request is merged, when the request gets freed.

0 commit comments

Comments
 (0)