Skip to content

Commit b243ddc

Browse files
htejunJens Axboe
authored andcommitted
block: move rq->start_time initialization to blk_rq_init()
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>
1 parent 2e60e02 commit b243ddc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎block/blk-core.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ void blk_rq_init(struct request_queue *q, struct request *rq)
134134
rq->cmd_len = BLK_MAX_CDB;
135135
rq->tag = -1;
136136
rq->ref_count = 1;
137+
rq->start_time = jiffies;
137138
}
138139
EXPORT_SYMBOL(blk_rq_init);
139140

@@ -1099,7 +1100,6 @@ void init_request_from_bio(struct request *req, struct bio *bio)
10991100
req->errors = 0;
11001101
req->hard_sector = req->sector = bio->bi_sector;
11011102
req->ioprio = bio_prio(bio);
1102-
req->start_time = jiffies;
11031103
blk_rq_bio_prep(req->q, req, bio);
11041104
}
11051105

0 commit comments

Comments
 (0)