Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4f2ac93c authored by Kent Overstreet's avatar Kent Overstreet
Browse files

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: default avatarKent Overstreet <koverstreet@google.com>
CC: Jens Axboe <axboe@kernel.dk>
parent 5b83636a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -927,7 +927,7 @@ bufinit(struct buf *buf, struct request *rq, struct bio *bio)
	buf->resid = bio->bi_size;
	buf->sector = bio->bi_sector;
	bio_pageinc(bio);
	buf->bv = bv = &bio->bi_io_vec[bio->bi_idx];
	buf->bv = bio_iovec(bio);
	buf->bv_resid = bv->bv_len;
	WARN_ON(buf->bv_resid == 0);
}
+0 −1
Original line number Diff line number Diff line
@@ -3777,7 +3777,6 @@ static int __floppy_read_block_0(struct block_device *bdev)
	bio_vec.bv_len = size;
	bio_vec.bv_offset = 0;
	bio.bi_vcnt = 1;
	bio.bi_idx = 0;
	bio.bi_size = size;
	bio.bi_bdev = bdev;
	bio.bi_sector = 0;
+1 −1
Original line number Diff line number Diff line
@@ -490,7 +490,7 @@ static int verity_map(struct dm_target *ti, struct bio *bio)

	bio->bi_end_io = verity_end_io;
	bio->bi_private = io;
	io->io_vec_size = bio->bi_vcnt - bio->bi_idx;
	io->io_vec_size = bio_segments(bio);
	if (io->io_vec_size < DM_VERITY_IO_VEC_INLINE)
		io->io_vec = io->io_vec_inline;
	else
+0 −1
Original line number Diff line number Diff line
@@ -4386,7 +4386,6 @@ read_more:
	read_bio->bi_flags &= ~(BIO_POOL_MASK - 1);
	read_bio->bi_flags |= 1 << BIO_UPTODATE;
	read_bio->bi_vcnt = 0;
	read_bio->bi_idx = 0;
	read_bio->bi_size = 0;
	r10_bio->master_bio = read_bio;
	r10_bio->read_slot = r10_bio->devs[r10_bio->read_slot].devnum;
+0 −1
Original line number Diff line number Diff line
@@ -2979,7 +2979,6 @@ int submit_bh(int rw, struct buffer_head * bh)
	bio->bi_io_vec[0].bv_offset = bh_offset(bh);

	bio->bi_vcnt = 1;
	bio->bi_idx = 0;
	bio->bi_size = bh->b_size;

	bio->bi_end_io = end_bio_bh_io_sync;
Loading