Skip to content

Commit

Permalink
blk-mq: simplify blk_mq_rq_timed_out
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Christoph Hellwig authored and axboe committed May 29, 2018
1 parent 88b0cfa commit d1210d5
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions block/blk-mq.c
Original file line number Diff line number Diff line change
Expand Up @@ -770,22 +770,16 @@ EXPORT_SYMBOL(blk_mq_tag_to_rq);

static void blk_mq_rq_timed_out(struct request *req, bool reserved)
{
const struct blk_mq_ops *ops = req->q->mq_ops;
enum blk_eh_timer_return ret = BLK_EH_RESET_TIMER;
if (req->q->mq_ops->timeout) {
enum blk_eh_timer_return ret;

if (ops->timeout)
ret = ops->timeout(req, reserved);

switch (ret) {
case BLK_EH_RESET_TIMER:
blk_add_timer(req);
break;
case BLK_EH_DONE:
break;
default:
printk(KERN_ERR "block: bad eh return: %d\n", ret);
break;
ret = req->q->mq_ops->timeout(req, reserved);
if (ret == BLK_EH_DONE)
return;
WARN_ON_ONCE(ret != BLK_EH_RESET_TIMER);
}

blk_add_timer(req);
}

static bool blk_mq_req_expired(struct request *rq, unsigned long *next)
Expand Down

0 comments on commit d1210d5

Please sign in to comment.