diff options
Diffstat (limited to 'drivers/block/ps3disk.c')
-rw-r--r-- | drivers/block/ps3disk.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c index aa8b890c80d7..8953e7ce0016 100644 --- a/drivers/block/ps3disk.c +++ b/drivers/block/ps3disk.c | |||
@@ -91,30 +91,30 @@ static void ps3disk_scatter_gather(struct ps3_storage_device *dev, | |||
91 | struct request *req, int gather) | 91 | struct request *req, int gather) |
92 | { | 92 | { |
93 | unsigned int offset = 0; | 93 | unsigned int offset = 0; |
94 | struct bio *bio; | 94 | struct req_iterator iter; |
95 | sector_t sector; | ||
96 | struct bio_vec *bvec; | 95 | struct bio_vec *bvec; |
97 | unsigned int i = 0, j; | 96 | unsigned int i = 0; |
98 | size_t size; | 97 | size_t size; |
99 | void *buf; | 98 | void *buf; |
100 | 99 | ||
101 | rq_for_each_bio(bio, req) { | 100 | rq_for_each_segment(bvec, req, iter) { |
102 | sector = bio->bi_sector; | 101 | unsigned long flags; |
103 | dev_dbg(&dev->sbd.core, | 102 | dev_dbg(&dev->sbd.core, |
104 | "%s:%u: bio %u: %u segs %u sectors from %lu\n", | 103 | "%s:%u: bio %u: %u segs %u sectors from %lu\n", |
105 | __func__, __LINE__, i, bio_segments(bio), | 104 | __func__, __LINE__, i, bio_segments(iter.bio), |
106 | bio_sectors(bio), sector); | 105 | bio_sectors(iter.bio), |
107 | bio_for_each_segment(bvec, bio, j) { | 106 | (unsigned long)iter.bio->bi_sector); |
107 | |||
108 | size = bvec->bv_len; | 108 | size = bvec->bv_len; |
109 | buf = __bio_kmap_atomic(bio, j, KM_IRQ0); | 109 | buf = bvec_kmap_irq(bvec, &flags); |
110 | if (gather) | 110 | if (gather) |
111 | memcpy(dev->bounce_buf+offset, buf, size); | 111 | memcpy(dev->bounce_buf+offset, buf, size); |
112 | else | 112 | else |
113 | memcpy(buf, dev->bounce_buf+offset, size); | 113 | memcpy(buf, dev->bounce_buf+offset, size); |
114 | offset += size; | 114 | offset += size; |
115 | flush_kernel_dcache_page(bio_iovec_idx(bio, j)->bv_page); | 115 | flush_kernel_dcache_page(bvec->bv_page); |
116 | __bio_kunmap_atomic(bio, KM_IRQ0); | 116 | bvec_kunmap_irq(bvec, &flags); |
117 | } | 117 | |
118 | i++; | 118 | i++; |
119 | } | 119 | } |
120 | } | 120 | } |
@@ -130,12 +130,13 @@ static int ps3disk_submit_request_sg(struct ps3_storage_device *dev, | |||
130 | 130 | ||
131 | #ifdef DEBUG | 131 | #ifdef DEBUG |
132 | unsigned int n = 0; | 132 | unsigned int n = 0; |
133 | struct bio *bio; | 133 | struct bio_vec *bv; |
134 | struct req_iterator iter; | ||
134 | 135 | ||
135 | rq_for_each_bio(bio, req) | 136 | rq_for_each_segment(bv, req, iter) |
136 | n++; | 137 | n++; |
137 | dev_dbg(&dev->sbd.core, | 138 | dev_dbg(&dev->sbd.core, |
138 | "%s:%u: %s req has %u bios for %lu sectors %lu hard sectors\n", | 139 | "%s:%u: %s req has %u bvecs for %lu sectors %lu hard sectors\n", |
139 | __func__, __LINE__, op, n, req->nr_sectors, | 140 | __func__, __LINE__, op, n, req->nr_sectors, |
140 | req->hard_nr_sectors); | 141 | req->hard_nr_sectors); |
141 | #endif | 142 | #endif |