aboutsummaryrefslogtreecommitdiffstats
path: root/fs/bio-integrity.c
diff options
context:
space:
mode:
authorKent Overstreet <koverstreet@google.com>2012-09-04 18:20:38 -0400
committerKent Overstreet <koverstreet@google.com>2013-03-23 17:15:30 -0400
commit5b83636ae3c3b4f87d02a5929ad4dee831534db0 (patch)
tree90b902fe8797c11d4f76d08353e44bbf82a850e1 /fs/bio-integrity.c
parentaa8b57aa3d1c06ca53312294ee6dfc767ee3ddb3 (diff)
block: Change bio_split() to respect the current value of bi_idx
In the current code bio_split() won't be seeing partially completed bios so this doesn't change any behaviour, but this makes the code a bit clearer as to what bio_split() actually requires. The immediate purpose of the patch is removing unnecessary bi_idx references, but the end goal is to allow partial completed bios to be submitted, which along with immutable biovecs enables effecient bio splitting. Some of the callers were (double) checking that bios could be split, so update their checks too. Signed-off-by: Kent Overstreet <koverstreet@google.com> CC: Jens Axboe <axboe@kernel.dk> CC: Lars Ellenberg <drbd-dev@lists.linbit.com> CC: Neil Brown <neilb@suse.de> CC: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'fs/bio-integrity.c')
-rw-r--r--fs/bio-integrity.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/bio-integrity.c b/fs/bio-integrity.c
index 8c4c604c840d..ca7b02dbf09d 100644
--- a/fs/bio-integrity.c
+++ b/fs/bio-integrity.c
@@ -661,8 +661,8 @@ void bio_integrity_split(struct bio *bio, struct bio_pair *bp, int sectors)
661 bp->bio1.bi_integrity = &bp->bip1; 661 bp->bio1.bi_integrity = &bp->bip1;
662 bp->bio2.bi_integrity = &bp->bip2; 662 bp->bio2.bi_integrity = &bp->bip2;
663 663
664 bp->iv1 = bip->bip_vec[0]; 664 bp->iv1 = bip->bip_vec[bip->bip_idx];
665 bp->iv2 = bip->bip_vec[0]; 665 bp->iv2 = bip->bip_vec[bip->bip_idx];
666 666
667 bp->bip1.bip_vec = &bp->iv1; 667 bp->bip1.bip_vec = &bp->iv1;
668 bp->bip2.bip_vec = &bp->iv2; 668 bp->bip2.bip_vec = &bp->iv2;