aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/xen-blkfront.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2007-09-25 06:35:59 -0400
committerJens Axboe <axboe@carl.home.kernel.dk>2007-10-10 03:25:56 -0400
commit5705f7021748a69d84d6567e68e8851dab551464 (patch)
tree5a6dbc8fc6055c0334f4a97540e36a7844b9c482 /drivers/block/xen-blkfront.c
parent9dfa52831e96194b8649613e3131baa2c109f7dc (diff)
Introduce rq_for_each_segment replacing rq_for_each_bio
Every usage of rq_for_each_bio wraps a usage of bio_for_each_segment, so these can be combined into rq_for_each_segment. We define "struct req_iterator" to hold the 'bio' and 'index' that are needed for the double iteration. Signed-off-by: Neil Brown <neilb@suse.de> Various compile fixes by me... Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/block/xen-blkfront.c')
-rw-r--r--drivers/block/xen-blkfront.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 964e51634f2d..6af250113c2a 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -150,9 +150,8 @@ static int blkif_queue_request(struct request *req)
150 struct blkfront_info *info = req->rq_disk->private_data; 150 struct blkfront_info *info = req->rq_disk->private_data;
151 unsigned long buffer_mfn; 151 unsigned long buffer_mfn;
152 struct blkif_request *ring_req; 152 struct blkif_request *ring_req;
153 struct bio *bio; 153 struct req_iterator iter;
154 struct bio_vec *bvec; 154 struct bio_vec *bvec;
155 int idx;
156 unsigned long id; 155 unsigned long id;
157 unsigned int fsect, lsect; 156 unsigned int fsect, lsect;
158 int ref; 157 int ref;
@@ -186,8 +185,7 @@ static int blkif_queue_request(struct request *req)
186 ring_req->operation = BLKIF_OP_WRITE_BARRIER; 185 ring_req->operation = BLKIF_OP_WRITE_BARRIER;
187 186
188 ring_req->nr_segments = 0; 187 ring_req->nr_segments = 0;
189 rq_for_each_bio (bio, req) { 188 rq_for_each_segment(bvec, req, iter) {
190 bio_for_each_segment (bvec, bio, idx) {
191 BUG_ON(ring_req->nr_segments 189 BUG_ON(ring_req->nr_segments
192 == BLKIF_MAX_SEGMENTS_PER_REQUEST); 190 == BLKIF_MAX_SEGMENTS_PER_REQUEST);
193 buffer_mfn = pfn_to_mfn(page_to_pfn(bvec->bv_page)); 191 buffer_mfn = pfn_to_mfn(page_to_pfn(bvec->bv_page));
@@ -213,7 +211,6 @@ static int blkif_queue_request(struct request *req)
213 .last_sect = lsect }; 211 .last_sect = lsect };
214 212
215 ring_req->nr_segments++; 213 ring_req->nr_segments++;
216 }
217 } 214 }
218 215
219 info->ring.req_prod_pvt++; 216 info->ring.req_prod_pvt++;