diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-11-23 20:19:00 -0500 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2013-11-24 01:33:49 -0500 |
commit | 7988613b0e5b2638caf6cd493cc78e9595eba19c (patch) | |
tree | cc9fc4e235278035313ee32940740f61269f8fb3 /drivers/md/bcache/debug.c | |
parent | a4ad39b1d10584dfcfcfb0d510faab2c7f034399 (diff) |
block: Convert bio_for_each_segment() to bvec_iter
More prep work for immutable biovecs - with immutable bvecs drivers
won't be able to use the biovec directly, they'll need to use helpers
that take into account bio->bi_iter.bi_bvec_done.
This updates callers for the new usage without changing the
implementation yet.
Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: "Ed L. Cashin" <ecashin@coraid.com>
Cc: Nick Piggin <npiggin@kernel.dk>
Cc: Lars Ellenberg <drbd-dev@lists.linbit.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Paul Clements <Paul.Clements@steeleye.com>
Cc: Jim Paris <jim@jtan.com>
Cc: Geoff Levand <geoff@infradead.org>
Cc: Yehuda Sadeh <yehuda@inktank.com>
Cc: Sage Weil <sage@inktank.com>
Cc: Alex Elder <elder@inktank.com>
Cc: ceph-devel@vger.kernel.org
Cc: Joshua Morris <josh.h.morris@us.ibm.com>
Cc: Philip Kelleher <pjk1939@linux.vnet.ibm.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Neil Brown <neilb@suse.de>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: linux390@de.ibm.com
Cc: Nagalakshmi Nandigama <Nagalakshmi.Nandigama@lsi.com>
Cc: Sreekanth Reddy <Sreekanth.Reddy@lsi.com>
Cc: support@lsi.com
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Guo Chao <yan@linux.vnet.ibm.com>
Cc: Asai Thambi S P <asamymuthupa@micron.com>
Cc: Selvan Mani <smani@micron.com>
Cc: Sam Bradshaw <sbradshaw@micron.com>
Cc: Matthew Wilcox <matthew.r.wilcox@intel.com>
Cc: Keith Busch <keith.busch@intel.com>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: Quoc-Son Anh <quoc-sonx.anh@intel.com>
Cc: Sebastian Ott <sebott@linux.vnet.ibm.com>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Jerome Marchand <jmarchan@redhat.com>
Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Jan Kara <jack@suse.cz>
Cc: linux-m68k@lists.linux-m68k.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: drbd-user@lists.linbit.com
Cc: nbd-general@lists.sourceforge.net
Cc: cbe-oss-dev@lists.ozlabs.org
Cc: xen-devel@lists.xensource.com
Cc: virtualization@lists.linux-foundation.org
Cc: linux-raid@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Cc: DL-MPTFusionLinux@lsi.com
Cc: linux-scsi@vger.kernel.org
Cc: devel@driverdev.osuosl.org
Cc: linux-fsdevel@vger.kernel.org
Cc: cluster-devel@redhat.com
Cc: linux-mm@kvack.org
Acked-by: Geoff Levand <geoff@infradead.org>
Diffstat (limited to 'drivers/md/bcache/debug.c')
-rw-r--r-- | drivers/md/bcache/debug.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c index 92b3fd468a03..03cb4d114e16 100644 --- a/drivers/md/bcache/debug.c +++ b/drivers/md/bcache/debug.c | |||
@@ -173,7 +173,8 @@ void bch_data_verify(struct cached_dev *dc, struct bio *bio) | |||
173 | { | 173 | { |
174 | char name[BDEVNAME_SIZE]; | 174 | char name[BDEVNAME_SIZE]; |
175 | struct bio *check; | 175 | struct bio *check; |
176 | struct bio_vec *bv; | 176 | struct bio_vec bv, *bv2; |
177 | struct bvec_iter iter; | ||
177 | int i; | 178 | int i; |
178 | 179 | ||
179 | check = bio_clone(bio, GFP_NOIO); | 180 | check = bio_clone(bio, GFP_NOIO); |
@@ -185,13 +186,13 @@ void bch_data_verify(struct cached_dev *dc, struct bio *bio) | |||
185 | 186 | ||
186 | submit_bio_wait(READ_SYNC, check); | 187 | submit_bio_wait(READ_SYNC, check); |
187 | 188 | ||
188 | bio_for_each_segment(bv, bio, i) { | 189 | bio_for_each_segment(bv, bio, iter) { |
189 | void *p1 = kmap_atomic(bv->bv_page); | 190 | void *p1 = kmap_atomic(bv.bv_page); |
190 | void *p2 = page_address(check->bi_io_vec[i].bv_page); | 191 | void *p2 = page_address(check->bi_io_vec[iter.bi_idx].bv_page); |
191 | 192 | ||
192 | cache_set_err_on(memcmp(p1 + bv->bv_offset, | 193 | cache_set_err_on(memcmp(p1 + bv.bv_offset, |
193 | p2 + bv->bv_offset, | 194 | p2 + bv.bv_offset, |
194 | bv->bv_len), | 195 | bv.bv_len), |
195 | dc->disk.c, | 196 | dc->disk.c, |
196 | "verify failed at dev %s sector %llu", | 197 | "verify failed at dev %s sector %llu", |
197 | bdevname(dc->bdev, name), | 198 | bdevname(dc->bdev, name), |
@@ -200,8 +201,8 @@ void bch_data_verify(struct cached_dev *dc, struct bio *bio) | |||
200 | kunmap_atomic(p1); | 201 | kunmap_atomic(p1); |
201 | } | 202 | } |
202 | 203 | ||
203 | bio_for_each_segment_all(bv, check, i) | 204 | bio_for_each_segment_all(bv2, check, i) |
204 | __free_page(bv->bv_page); | 205 | __free_page(bv2->bv_page); |
205 | out_put: | 206 | out_put: |
206 | bio_put(check); | 207 | bio_put(check); |
207 | } | 208 | } |