Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 061a5427 authored by Jens Axboe's avatar Jens Axboe
Browse files

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: default avatarAgarwal, Anchal <anchalag@amazon.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent b8dcdab3
Loading
Loading
Loading
Loading
+14 −7
Original line number Original line Diff line number Diff line
@@ -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;
	int inflight, limit;


	if (!(wb_acct & WBT_TRACKED))
		return;

	rqw = get_rq_wait(rwb, wb_acct);
	inflight = atomic_dec_return(&rqw->inflight);
	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
 * Called on completion of a request. Note that it's also called when
 * a request is merged, when the request gets freed.
 * a request is merged, when the request gets freed.