@@ -3852,6 +3852,19 @@ static bool blk_mq_poll_hybrid(struct request_queue *q,
return blk_mq_poll_hybrid_sleep(q, rq);
}
+static inline int blk_mq_poll_hctx(struct request_queue *q,
+ struct blk_mq_hw_ctx *hctx)
+{
+ int ret;
+
+ hctx->poll_invoked++;
+ ret = q->mq_ops->poll(hctx);
+ if (ret > 0)
+ hctx->poll_success++;
+
+ return ret;
+}
+
static int blk_bio_poll(struct request_queue *q, blk_qc_t cookie, bool spin)
{
/*
@@ -3908,11 +3921,8 @@ int blk_poll(struct request_queue *q, blk_qc_t cookie, bool spin)
do {
int ret;
- hctx->poll_invoked++;
-
- ret = q->mq_ops->poll(hctx);
+ ret = blk_mq_poll_hctx(q, hctx);
if (ret > 0) {
- hctx->poll_success++;
__set_current_state(TASK_RUNNING);
return ret;
}