public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: fold __blk_add_timer into blk_add_timer
@ 2014-04-25 12:14 Christoph Hellwig
  0 siblings, 0 replies; only message in thread
From: Christoph Hellwig @ 2014-04-25 12:14 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-kernel

Signed-off-by: Christoph Hellwig <hch@lst.de>

diff --git a/block/blk-timeout.c b/block/blk-timeout.c
index 49988a3..4487456 100644
--- a/block/blk-timeout.c
+++ b/block/blk-timeout.c
@@ -166,8 +166,15 @@ void blk_abort_request(struct request *req)
 }
 EXPORT_SYMBOL_GPL(blk_abort_request);
 
-static void __blk_add_timer(struct request *req,
-			    struct list_head *timeout_list)
+/**
+ * blk_add_timer - Start timeout timer for a single request
+ * @req:	request that is about to start running.
+ *
+ * Notes:
+ *    Each request has its own timer, and as it is added to the queue, we
+ *    set up the timer. When the request completes, we cancel the timer.
+ */
+void blk_add_timer(struct request *req)
 {
 	struct request_queue *q = req->q;
 	unsigned long expiry;
@@ -185,8 +192,8 @@ static void __blk_add_timer(struct request *req,
 		req->timeout = q->rq_timeout;
 
 	req->deadline = jiffies + req->timeout;
-	if (timeout_list)
-		list_add_tail(&req->timeout_list, timeout_list);
+	if (!q->mq_ops)
+		list_add_tail(&req->timeout_list, &req->q->timeout_list);
 
 	/*
 	 * If the timer isn't already pending or this timeout is earlier
@@ -211,22 +218,3 @@ static void __blk_add_timer(struct request *req,
 	}
 
 }
-
-/**
- * blk_add_timer - Start timeout timer for a single request
- * @req:	request that is about to start running.
- *
- * Notes:
- *    Each request has its own timer, and as it is added to the queue, we
- *    set up the timer. When the request completes, we cancel the timer.
- */
-void blk_add_timer(struct request *req)
-{
-	struct request_queue *q = req->q;
-
-	if (q->mq_ops)
-		__blk_add_timer(req, NULL);
-	else
-		__blk_add_timer(req, &req->q->timeout_list);
-}
-

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-04-25 12:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-25 12:14 [PATCH] block: fold __blk_add_timer into blk_add_timer Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox