aboutsummaryrefslogtreecommitdiffstats
path: root/fs/bio.c
diff options
context:
space:
mode:
authorKent Overstreet <kmo@daterainc.com>2013-08-07 17:24:32 -0400
committerKent Overstreet <kmo@daterainc.com>2013-11-24 01:33:49 -0500
commita4ad39b1d10584dfcfcfb0d510faab2c7f034399 (patch)
treea0747f9978fceb202975f43f15ed4489c6600894 /fs/bio.c
parent75d5d8156500cd3833d66806889372e294af514d (diff)
block: Convert bio_iovec() to bvec_iter
For immutable biovecs, we'll be introducing a new bio_iovec() that uses our new bvec iterator to construct a biovec, taking into account bvec_iter->bi_bvec_done - this patch updates existing users for the new usage. Some of the existing users really do need a pointer into the bvec array - those uses are all going to be removed, but we'll need the functionality from immutable to remove them - so for now rename the existing bio_iovec() -> __bio_iovec(), and it'll be removed in a couple patches. Signed-off-by: Kent Overstreet <kmo@daterainc.com> Cc: Jens Axboe <axboe@kernel.dk> Cc: "Ed L. Cashin" <ecashin@coraid.com> Cc: Alasdair Kergon <agk@redhat.com> Cc: dm-devel@redhat.com Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Diffstat (limited to 'fs/bio.c')
-rw-r--r--fs/bio.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/bio.c b/fs/bio.c
index a402ad6e753f..7bb281fc3d5c 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -821,12 +821,12 @@ void bio_advance(struct bio *bio, unsigned bytes)
821 break; 821 break;
822 } 822 }
823 823
824 if (bytes >= bio_iovec(bio)->bv_len) { 824 if (bytes >= bio_iovec(bio).bv_len) {
825 bytes -= bio_iovec(bio)->bv_len; 825 bytes -= bio_iovec(bio).bv_len;
826 bio->bi_iter.bi_idx++; 826 bio->bi_iter.bi_idx++;
827 } else { 827 } else {
828 bio_iovec(bio)->bv_len -= bytes; 828 bio_iovec(bio).bv_len -= bytes;
829 bio_iovec(bio)->bv_offset += bytes; 829 bio_iovec(bio).bv_offset += bytes;
830 bytes = 0; 830 bytes = 0;
831 } 831 }
832 } 832 }
@@ -879,8 +879,8 @@ void bio_copy_data(struct bio *dst, struct bio *src)
879 unsigned src_offset, dst_offset, bytes; 879 unsigned src_offset, dst_offset, bytes;
880 void *src_p, *dst_p; 880 void *src_p, *dst_p;
881 881
882 src_bv = bio_iovec(src); 882 src_bv = __bio_iovec(src);
883 dst_bv = bio_iovec(dst); 883 dst_bv = __bio_iovec(dst);
884 884
885 src_offset = src_bv->bv_offset; 885 src_offset = src_bv->bv_offset;
886 dst_offset = dst_bv->bv_offset; 886 dst_offset = dst_bv->bv_offset;
@@ -893,7 +893,7 @@ void bio_copy_data(struct bio *dst, struct bio *src)
893 if (!src) 893 if (!src)
894 break; 894 break;
895 895
896 src_bv = bio_iovec(src); 896 src_bv = __bio_iovec(src);
897 } 897 }
898 898
899 src_offset = src_bv->bv_offset; 899 src_offset = src_bv->bv_offset;
@@ -906,7 +906,7 @@ void bio_copy_data(struct bio *dst, struct bio *src)
906 if (!dst) 906 if (!dst)
907 break; 907 break;
908 908
909 dst_bv = bio_iovec(dst); 909 dst_bv = __bio_iovec(dst);
910 } 910 }
911 911
912 dst_offset = dst_bv->bv_offset; 912 dst_offset = dst_bv->bv_offset;
@@ -1776,8 +1776,8 @@ struct bio_pair *bio_split(struct bio *bi, int first_sectors)
1776 bp->bio1.bi_iter.bi_size = first_sectors << 9; 1776 bp->bio1.bi_iter.bi_size = first_sectors << 9;
1777 1777
1778 if (bi->bi_vcnt != 0) { 1778 if (bi->bi_vcnt != 0) {
1779 bp->bv1 = *bio_iovec(bi); 1779 bp->bv1 = bio_iovec(bi);
1780 bp->bv2 = *bio_iovec(bi); 1780 bp->bv2 = bio_iovec(bi);
1781 1781
1782 if (bio_is_rw(bi)) { 1782 if (bio_is_rw(bi)) {
1783 bp->bv2.bv_offset += first_sectors << 9; 1783 bp->bv2.bv_offset += first_sectors << 9;