summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--block/blk-mq.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 049e9dce1149..1978eef95dca 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -5192,27 +5192,19 @@ EXPORT_SYMBOL_GPL(blk_mq_update_nr_hw_queues);
static int blk_hctx_poll(struct request_queue *q, struct blk_mq_hw_ctx *hctx,
struct io_comp_batch *iob, unsigned int flags)
{
- long state = get_current_state();
int ret;
do {
ret = q->mq_ops->poll(hctx, iob);
- if (ret > 0) {
- __set_current_state(TASK_RUNNING);
+ if (ret > 0)
return ret;
- }
-
- if (signal_pending_state(state, current))
- __set_current_state(TASK_RUNNING);
- if (task_is_running(current))
+ if (task_sigpending(current))
return 1;
-
if (ret < 0 || (flags & BLK_POLL_ONESHOT))
break;
cpu_relax();
} while (!need_resched());
- __set_current_state(TASK_RUNNING);
return 0;
}