block: move rq->start_time initialization to blk_rq_init()
authorTejun Heo <tj@kernel.org>
Thu, 23 Apr 2009 02:05:18 +0000 (11:05 +0900)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 28 Apr 2009 05:37:35 +0000 (07:37 +0200)
rq->start_time was initialized in init_request_from_bio() so special
requests didn't have start_time set.  This has been okay as start_time
has been used only for fs requests; however, there is no indication of
this actually is the case or not.  Set rq->start_time in blk_rq_init()
and guarantee that all initialized rq's have its start_time set.  This
improves consistency at virtually no cost and future changes will make
use of the timestamp for !bio requests.

[ Impact: rq->start_time is valid for all requests ]

Signed-off-by: Tejun Heo <tj@kernel.org>
block/blk-core.c

index 89cc05d..b84250d 100644 (file)
@@ -134,6 +134,7 @@ void blk_rq_init(struct request_queue *q, struct request *rq)
        rq->cmd_len = BLK_MAX_CDB;
        rq->tag = -1;
        rq->ref_count = 1;
+       rq->start_time = jiffies;
 }
 EXPORT_SYMBOL(blk_rq_init);
 
@@ -1099,7 +1100,6 @@ void init_request_from_bio(struct request *req, struct bio *bio)
        req->errors = 0;
        req->hard_sector = req->sector = bio->bi_sector;
        req->ioprio = bio_prio(bio);
-       req->start_time = jiffies;
        blk_rq_bio_prep(req->q, req, bio);
 }