diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-10-11 18:44:27 -0400 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2013-11-24 01:33:47 -0500 |
commit | 4f024f3797c43cb4b73cd2c50cec728842d0e49e (patch) | |
tree | 3aedcab02d2ad723a189d01934d1e94fec7a54e1 /fs/btrfs/volumes.c | |
parent | ed9c47bebeeea4a468b07cfd745c690190f8014c (diff) |
block: Abstract out bvec iterator
Immutable biovecs are going to require an explicit iterator. To
implement immutable bvecs, a later patch is going to add a bi_bvec_done
member to this struct; for now, this patch effectively just renames
things.
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: Matthew Wilcox <willy@linux.intel.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: Rusty Russell <rusty@rustcorp.com.au>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Neil Brown <neilb@suse.de>
Cc: Alasdair Kergon <agk@redhat.com>
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: dm-devel@redhat.com
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: linux390@de.ibm.com
Cc: Boaz Harrosh <bharrosh@panasas.com>
Cc: Benny Halevy <bhalevy@tonian.com>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Chris Mason <chris.mason@fusionio.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Dave Kleikamp <shaggy@kernel.org>
Cc: Joern Engel <joern@logfs.org>
Cc: Prasad Joshi <prasadjoshi.linux@gmail.com>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: KONISHI Ryusuke <konishi.ryusuke@lab.ntt.co.jp>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Ben Myers <bpm@sgi.com>
Cc: xfs@oss.sgi.com
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
Cc: Ben Hutchings <ben@decadent.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Guo Chao <yan@linux.vnet.ibm.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Asai Thambi S P <asamymuthupa@micron.com>
Cc: Selvan Mani <smani@micron.com>
Cc: Sam Bradshaw <sbradshaw@micron.com>
Cc: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Cc: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Sebastian Ott <sebott@linux.vnet.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Jiang Liu <jiang.liu@huawei.com>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Jerome Marchand <jmarchand@redhat.com>
Cc: Joe Perches <joe@perches.com>
Cc: Peng Tao <tao.peng@emc.com>
Cc: Andy Adamson <andros@netapp.com>
Cc: fanchaoting <fanchaoting@cn.fujitsu.com>
Cc: Jie Liu <jeff.liu@oracle.com>
Cc: Sunil Mushran <sunil.mushran@gmail.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Namjae Jeon <namjae.jeon@samsung.com>
Cc: Pankaj Kumar <pankaj.km@samsung.com>
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: Mel Gorman <mgorman@suse.de>6
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 92303f42baaa..f2130de0ddc2 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -5411,7 +5411,7 @@ static int bio_size_ok(struct block_device *bdev, struct bio *bio, | |||
5411 | if (!q->merge_bvec_fn) | 5411 | if (!q->merge_bvec_fn) |
5412 | return 1; | 5412 | return 1; |
5413 | 5413 | ||
5414 | bvm.bi_size = bio->bi_size - prev->bv_len; | 5414 | bvm.bi_size = bio->bi_iter.bi_size - prev->bv_len; |
5415 | if (q->merge_bvec_fn(q, &bvm, prev) < prev->bv_len) | 5415 | if (q->merge_bvec_fn(q, &bvm, prev) < prev->bv_len) |
5416 | return 0; | 5416 | return 0; |
5417 | return 1; | 5417 | return 1; |
@@ -5426,7 +5426,7 @@ static void submit_stripe_bio(struct btrfs_root *root, struct btrfs_bio *bbio, | |||
5426 | bio->bi_private = bbio; | 5426 | bio->bi_private = bbio; |
5427 | btrfs_io_bio(bio)->stripe_index = dev_nr; | 5427 | btrfs_io_bio(bio)->stripe_index = dev_nr; |
5428 | bio->bi_end_io = btrfs_end_bio; | 5428 | bio->bi_end_io = btrfs_end_bio; |
5429 | bio->bi_sector = physical >> 9; | 5429 | bio->bi_iter.bi_sector = physical >> 9; |
5430 | #ifdef DEBUG | 5430 | #ifdef DEBUG |
5431 | { | 5431 | { |
5432 | struct rcu_string *name; | 5432 | struct rcu_string *name; |
@@ -5464,7 +5464,7 @@ again: | |||
5464 | while (bvec <= (first_bio->bi_io_vec + first_bio->bi_vcnt - 1)) { | 5464 | while (bvec <= (first_bio->bi_io_vec + first_bio->bi_vcnt - 1)) { |
5465 | if (bio_add_page(bio, bvec->bv_page, bvec->bv_len, | 5465 | if (bio_add_page(bio, bvec->bv_page, bvec->bv_len, |
5466 | bvec->bv_offset) < bvec->bv_len) { | 5466 | bvec->bv_offset) < bvec->bv_len) { |
5467 | u64 len = bio->bi_size; | 5467 | u64 len = bio->bi_iter.bi_size; |
5468 | 5468 | ||
5469 | atomic_inc(&bbio->stripes_pending); | 5469 | atomic_inc(&bbio->stripes_pending); |
5470 | submit_stripe_bio(root, bbio, bio, physical, dev_nr, | 5470 | submit_stripe_bio(root, bbio, bio, physical, dev_nr, |
@@ -5486,7 +5486,7 @@ static void bbio_error(struct btrfs_bio *bbio, struct bio *bio, u64 logical) | |||
5486 | bio->bi_private = bbio->private; | 5486 | bio->bi_private = bbio->private; |
5487 | bio->bi_end_io = bbio->end_io; | 5487 | bio->bi_end_io = bbio->end_io; |
5488 | btrfs_io_bio(bio)->mirror_num = bbio->mirror_num; | 5488 | btrfs_io_bio(bio)->mirror_num = bbio->mirror_num; |
5489 | bio->bi_sector = logical >> 9; | 5489 | bio->bi_iter.bi_sector = logical >> 9; |
5490 | kfree(bbio); | 5490 | kfree(bbio); |
5491 | bio_endio(bio, -EIO); | 5491 | bio_endio(bio, -EIO); |
5492 | } | 5492 | } |
@@ -5497,7 +5497,7 @@ int btrfs_map_bio(struct btrfs_root *root, int rw, struct bio *bio, | |||
5497 | { | 5497 | { |
5498 | struct btrfs_device *dev; | 5498 | struct btrfs_device *dev; |
5499 | struct bio *first_bio = bio; | 5499 | struct bio *first_bio = bio; |
5500 | u64 logical = (u64)bio->bi_sector << 9; | 5500 | u64 logical = (u64)bio->bi_iter.bi_sector << 9; |
5501 | u64 length = 0; | 5501 | u64 length = 0; |
5502 | u64 map_length; | 5502 | u64 map_length; |
5503 | u64 *raid_map = NULL; | 5503 | u64 *raid_map = NULL; |
@@ -5506,7 +5506,7 @@ int btrfs_map_bio(struct btrfs_root *root, int rw, struct bio *bio, | |||
5506 | int total_devs = 1; | 5506 | int total_devs = 1; |
5507 | struct btrfs_bio *bbio = NULL; | 5507 | struct btrfs_bio *bbio = NULL; |
5508 | 5508 | ||
5509 | length = bio->bi_size; | 5509 | length = bio->bi_iter.bi_size; |
5510 | map_length = length; | 5510 | map_length = length; |
5511 | 5511 | ||
5512 | ret = __btrfs_map_block(root->fs_info, rw, logical, &map_length, &bbio, | 5512 | ret = __btrfs_map_block(root->fs_info, rw, logical, &map_length, &bbio, |