diff options
author | NeilBrown <neilb@suse.de> | 2007-08-16 07:31:30 -0400 |
---|---|---|
committer | Jens Axboe <axboe@carl.home.kernel.dk> | 2007-10-10 03:25:56 -0400 |
commit | bc1c56fde6dd1c85e2047c276456c07bd4508b5c (patch) | |
tree | 1e9fb5fd927a33a4d63180f386b7e4385f613ed1 /block/ll_rw_blk.c | |
parent | 66846572bfb4ec62bcba260028cbbcbdb77bd636 (diff) |
Share code between init_request_from_bio and blk_rq_bio_prep
These have very similar functions and should share code where
possible.
Signed-off-by: Neil Brown <neilb@suse.de>
diff .prev/block/ll_rw_blk.c ./block/ll_rw_blk.c
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/ll_rw_blk.c')
-rw-r--r-- | block/ll_rw_blk.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index eb27b335d238..e0608c4ecc23 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c | |||
@@ -2941,15 +2941,9 @@ static void init_request_from_bio(struct request *req, struct bio *bio) | |||
2941 | 2941 | ||
2942 | req->errors = 0; | 2942 | req->errors = 0; |
2943 | req->hard_sector = req->sector = bio->bi_sector; | 2943 | req->hard_sector = req->sector = bio->bi_sector; |
2944 | req->hard_nr_sectors = req->nr_sectors = bio_sectors(bio); | ||
2945 | req->current_nr_sectors = req->hard_cur_sectors = bio_cur_sectors(bio); | ||
2946 | req->nr_phys_segments = bio_phys_segments(req->q, bio); | ||
2947 | req->nr_hw_segments = bio_hw_segments(req->q, bio); | ||
2948 | req->buffer = bio_data(bio); /* see ->buffer comment above */ | ||
2949 | req->bio = req->biotail = bio; | ||
2950 | req->ioprio = bio_prio(bio); | 2944 | req->ioprio = bio_prio(bio); |
2951 | req->rq_disk = bio->bi_bdev->bd_disk; | ||
2952 | req->start_time = jiffies; | 2945 | req->start_time = jiffies; |
2946 | blk_rq_bio_prep(req->q, req, bio); | ||
2953 | } | 2947 | } |
2954 | 2948 | ||
2955 | static int __make_request(struct request_queue *q, struct bio *bio) | 2949 | static int __make_request(struct request_queue *q, struct bio *bio) |