aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKent Overstreet <koverstreet@google.com>2012-09-04 18:23:14 -0400
committerKent Overstreet <koverstreet@google.com>2013-03-23 17:15:31 -0400
commit4f2ac93c175c4922bdddbfec6cad94b32cea0070 (patch)
treece9df811f8a59c3af8486ee20fdc9d36fe5bfd25
parent5b83636ae3c3b4f87d02a5929ad4dee831534db0 (diff)
block: Remove bi_idx references
For immutable bvecs, all bi_idx usage needs to be audited - so here we're removing all the unnecessary uses. Most of these are places where it was being initialized on a bio that was just allocated, a few others are conversions to standard macros. Signed-off-by: Kent Overstreet <koverstreet@google.com> CC: Jens Axboe <axboe@kernel.dk>
-rw-r--r--drivers/block/aoe/aoecmd.c2
-rw-r--r--drivers/block/floppy.c1
-rw-r--r--drivers/md/dm-verity.c2
-rw-r--r--drivers/md/raid10.c1
-rw-r--r--fs/buffer.c1
-rw-r--r--fs/jfs/jfs_logmgr.c2
-rw-r--r--fs/logfs/dev_bdev.c5
-rw-r--r--mm/page_io.c1
8 files changed, 2 insertions, 13 deletions
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index 25ef5c014fca..8188ad131b97 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -927,7 +927,7 @@ bufinit(struct buf *buf, struct request *rq, struct bio *bio)
927 buf->resid = bio->bi_size; 927 buf->resid = bio->bi_size;
928 buf->sector = bio->bi_sector; 928 buf->sector = bio->bi_sector;
929 bio_pageinc(bio); 929 bio_pageinc(bio);
930 buf->bv = bv = &bio->bi_io_vec[bio->bi_idx]; 930 buf->bv = bio_iovec(bio);
931 buf->bv_resid = bv->bv_len; 931 buf->bv_resid = bv->bv_len;
932 WARN_ON(buf->bv_resid == 0); 932 WARN_ON(buf->bv_resid == 0);
933} 933}
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 2ddd64a9ffde..83232639034e 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -3777,7 +3777,6 @@ static int __floppy_read_block_0(struct block_device *bdev)
3777 bio_vec.bv_len = size; 3777 bio_vec.bv_len = size;
3778 bio_vec.bv_offset = 0; 3778 bio_vec.bv_offset = 0;
3779 bio.bi_vcnt = 1; 3779 bio.bi_vcnt = 1;
3780 bio.bi_idx = 0;
3781 bio.bi_size = size; 3780 bio.bi_size = size;
3782 bio.bi_bdev = bdev; 3781 bio.bi_bdev = bdev;
3783 bio.bi_sector = 0; 3782 bio.bi_sector = 0;
diff --git a/drivers/md/dm-verity.c b/drivers/md/dm-verity.c
index 923115d08baa..4f06d9adf1ed 100644
--- a/drivers/md/dm-verity.c
+++ b/drivers/md/dm-verity.c
@@ -490,7 +490,7 @@ static int verity_map(struct dm_target *ti, struct bio *bio)
490 490
491 bio->bi_end_io = verity_end_io; 491 bio->bi_end_io = verity_end_io;
492 bio->bi_private = io; 492 bio->bi_private = io;
493 io->io_vec_size = bio->bi_vcnt - bio->bi_idx; 493 io->io_vec_size = bio_segments(bio);
494 if (io->io_vec_size < DM_VERITY_IO_VEC_INLINE) 494 if (io->io_vec_size < DM_VERITY_IO_VEC_INLINE)
495 io->io_vec = io->io_vec_inline; 495 io->io_vec = io->io_vec_inline;
496 else 496 else
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 2e29df960bf5..6ffb6c08aec5 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -4386,7 +4386,6 @@ read_more:
4386 read_bio->bi_flags &= ~(BIO_POOL_MASK - 1); 4386 read_bio->bi_flags &= ~(BIO_POOL_MASK - 1);
4387 read_bio->bi_flags |= 1 << BIO_UPTODATE; 4387 read_bio->bi_flags |= 1 << BIO_UPTODATE;
4388 read_bio->bi_vcnt = 0; 4388 read_bio->bi_vcnt = 0;
4389 read_bio->bi_idx = 0;
4390 read_bio->bi_size = 0; 4389 read_bio->bi_size = 0;
4391 r10_bio->master_bio = read_bio; 4390 r10_bio->master_bio = read_bio;
4392 r10_bio->read_slot = r10_bio->devs[r10_bio->read_slot].devnum; 4391 r10_bio->read_slot = r10_bio->devs[r10_bio->read_slot].devnum;
diff --git a/fs/buffer.c b/fs/buffer.c
index b4dcb34c9635..ecd3792ae0e9 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2979,7 +2979,6 @@ int submit_bh(int rw, struct buffer_head * bh)
2979 bio->bi_io_vec[0].bv_offset = bh_offset(bh); 2979 bio->bi_io_vec[0].bv_offset = bh_offset(bh);
2980 2980
2981 bio->bi_vcnt = 1; 2981 bio->bi_vcnt = 1;
2982 bio->bi_idx = 0;
2983 bio->bi_size = bh->b_size; 2982 bio->bi_size = bh->b_size;
2984 2983
2985 bio->bi_end_io = end_bio_bh_io_sync; 2984 bio->bi_end_io = end_bio_bh_io_sync;
diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c
index 2eb952c41a69..8ae5e350da43 100644
--- a/fs/jfs/jfs_logmgr.c
+++ b/fs/jfs/jfs_logmgr.c
@@ -2004,7 +2004,6 @@ static int lbmRead(struct jfs_log * log, int pn, struct lbuf ** bpp)
2004 bio->bi_io_vec[0].bv_offset = bp->l_offset; 2004 bio->bi_io_vec[0].bv_offset = bp->l_offset;
2005 2005
2006 bio->bi_vcnt = 1; 2006 bio->bi_vcnt = 1;
2007 bio->bi_idx = 0;
2008 bio->bi_size = LOGPSIZE; 2007 bio->bi_size = LOGPSIZE;
2009 2008
2010 bio->bi_end_io = lbmIODone; 2009 bio->bi_end_io = lbmIODone;
@@ -2145,7 +2144,6 @@ static void lbmStartIO(struct lbuf * bp)
2145 bio->bi_io_vec[0].bv_offset = bp->l_offset; 2144 bio->bi_io_vec[0].bv_offset = bp->l_offset;
2146 2145
2147 bio->bi_vcnt = 1; 2146 bio->bi_vcnt = 1;
2148 bio->bi_idx = 0;
2149 bio->bi_size = LOGPSIZE; 2147 bio->bi_size = LOGPSIZE;
2150 2148
2151 bio->bi_end_io = lbmIODone; 2149 bio->bi_end_io = lbmIODone;
diff --git a/fs/logfs/dev_bdev.c b/fs/logfs/dev_bdev.c
index e784a217b500..550475ca6a0e 100644
--- a/fs/logfs/dev_bdev.c
+++ b/fs/logfs/dev_bdev.c
@@ -32,7 +32,6 @@ static int sync_request(struct page *page, struct block_device *bdev, int rw)
32 bio_vec.bv_len = PAGE_SIZE; 32 bio_vec.bv_len = PAGE_SIZE;
33 bio_vec.bv_offset = 0; 33 bio_vec.bv_offset = 0;
34 bio.bi_vcnt = 1; 34 bio.bi_vcnt = 1;
35 bio.bi_idx = 0;
36 bio.bi_size = PAGE_SIZE; 35 bio.bi_size = PAGE_SIZE;
37 bio.bi_bdev = bdev; 36 bio.bi_bdev = bdev;
38 bio.bi_sector = page->index * (PAGE_SIZE >> 9); 37 bio.bi_sector = page->index * (PAGE_SIZE >> 9);
@@ -108,7 +107,6 @@ static int __bdev_writeseg(struct super_block *sb, u64 ofs, pgoff_t index,
108 if (i >= max_pages) { 107 if (i >= max_pages) {
109 /* Block layer cannot split bios :( */ 108 /* Block layer cannot split bios :( */
110 bio->bi_vcnt = i; 109 bio->bi_vcnt = i;
111 bio->bi_idx = 0;
112 bio->bi_size = i * PAGE_SIZE; 110 bio->bi_size = i * PAGE_SIZE;
113 bio->bi_bdev = super->s_bdev; 111 bio->bi_bdev = super->s_bdev;
114 bio->bi_sector = ofs >> 9; 112 bio->bi_sector = ofs >> 9;
@@ -136,7 +134,6 @@ static int __bdev_writeseg(struct super_block *sb, u64 ofs, pgoff_t index,
136 unlock_page(page); 134 unlock_page(page);
137 } 135 }
138 bio->bi_vcnt = nr_pages; 136 bio->bi_vcnt = nr_pages;
139 bio->bi_idx = 0;
140 bio->bi_size = nr_pages * PAGE_SIZE; 137 bio->bi_size = nr_pages * PAGE_SIZE;
141 bio->bi_bdev = super->s_bdev; 138 bio->bi_bdev = super->s_bdev;
142 bio->bi_sector = ofs >> 9; 139 bio->bi_sector = ofs >> 9;
@@ -202,7 +199,6 @@ static int do_erase(struct super_block *sb, u64 ofs, pgoff_t index,
202 if (i >= max_pages) { 199 if (i >= max_pages) {
203 /* Block layer cannot split bios :( */ 200 /* Block layer cannot split bios :( */
204 bio->bi_vcnt = i; 201 bio->bi_vcnt = i;
205 bio->bi_idx = 0;
206 bio->bi_size = i * PAGE_SIZE; 202 bio->bi_size = i * PAGE_SIZE;
207 bio->bi_bdev = super->s_bdev; 203 bio->bi_bdev = super->s_bdev;
208 bio->bi_sector = ofs >> 9; 204 bio->bi_sector = ofs >> 9;
@@ -224,7 +220,6 @@ static int do_erase(struct super_block *sb, u64 ofs, pgoff_t index,
224 bio->bi_io_vec[i].bv_offset = 0; 220 bio->bi_io_vec[i].bv_offset = 0;
225 } 221 }
226 bio->bi_vcnt = nr_pages; 222 bio->bi_vcnt = nr_pages;
227 bio->bi_idx = 0;
228 bio->bi_size = nr_pages * PAGE_SIZE; 223 bio->bi_size = nr_pages * PAGE_SIZE;
229 bio->bi_bdev = super->s_bdev; 224 bio->bi_bdev = super->s_bdev;
230 bio->bi_sector = ofs >> 9; 225 bio->bi_sector = ofs >> 9;
diff --git a/mm/page_io.c b/mm/page_io.c
index 78eee32ee486..8d3c0c088105 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -35,7 +35,6 @@ static struct bio *get_swap_bio(gfp_t gfp_flags,
35 bio->bi_io_vec[0].bv_len = PAGE_SIZE; 35 bio->bi_io_vec[0].bv_len = PAGE_SIZE;
36 bio->bi_io_vec[0].bv_offset = 0; 36 bio->bi_io_vec[0].bv_offset = 0;
37 bio->bi_vcnt = 1; 37 bio->bi_vcnt = 1;
38 bio->bi_idx = 0;
39 bio->bi_size = PAGE_SIZE; 38 bio->bi_size = PAGE_SIZE;
40 bio->bi_end_io = end_io; 39 bio->bi_end_io = end_io;
41 } 40 }