aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2015-01-07 18:55:46 -0700
committerJens Axboe <axboe@fb.com>2015-01-08 08:59:01 -0700
commit5b3f25fc343690cafd3e27431a69a7bdaf9df001 (patch)
tree8892062d8290c520faf5daf355bcc303501919d5 /block
parentblk-mq: Add helper to abort requeued requests (diff)
downloadlinux-dev-5b3f25fc343690cafd3e27431a69a7bdaf9df001.tar.xz
linux-dev-5b3f25fc343690cafd3e27431a69a7bdaf9df001.zip
blk-mq: Allow requests to never expire
Some types of requests may be started that are not gauranteed to ever complete. This adds a request flag that a driver can use so mark the request as such. Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq.c4
-rw-r--r--block/blk-timeout.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 261ccd89e15d..78324a2f0e10 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -619,7 +619,7 @@ void blk_mq_rq_timed_out(struct request *req, bool reserved)
break;
}
}
-
+
static void blk_mq_check_expired(struct blk_mq_hw_ctx *hctx,
struct request *rq, void *priv, bool reserved)
{
@@ -627,6 +627,8 @@ static void blk_mq_check_expired(struct blk_mq_hw_ctx *hctx,
if (!test_bit(REQ_ATOM_STARTED, &rq->atomic_flags))
return;
+ if (rq->cmd_flags & REQ_NO_TIMEOUT)
+ return;
if (time_after_eq(jiffies, rq->deadline)) {
if (!blk_mark_rq_complete(rq))
diff --git a/block/blk-timeout.c b/block/blk-timeout.c
index 56c025894cdf..246dfb16c3d9 100644
--- a/block/blk-timeout.c
+++ b/block/blk-timeout.c
@@ -190,6 +190,9 @@ void blk_add_timer(struct request *req)
struct request_queue *q = req->q;
unsigned long expiry;
+ if (req->cmd_flags & REQ_NO_TIMEOUT)
+ return;
+
/* blk-mq has its own handler, so we don't need ->rq_timed_out_fn */
if (!q->mq_ops && !q->rq_timed_out_fn)
return;