diff options
author | Liu Bo <bo.li.liu@oracle.com> | 2017-05-15 15:33:27 -0700 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-06-19 18:25:59 +0200 |
commit | 17347cec15f919901c90cdbf98af47ed2ed28b9f (patch) | |
tree | 27fa6d42856840f59bf9cc1cb042ee234a355cf1 /fs/btrfs/volumes.h | |
parent | 725130bac5857ac035cf9f47d2973ee4e734db54 (diff) | |
download | linux-17347cec15f919901c90cdbf98af47ed2ed28b9f.tar.bz2 |
Btrfs: change how we iterate bios in endio
Since dio submit has used bio_clone_fast, the submitted bio may not have a
reliable bi_vcnt, for the bio vector iterations in checksum related
functions, bio->bi_iter is not modified yet and it's safe to use
bio_for_each_segment, while for those bio vector iterations in dio read's
endio, we now save a copy of bvec_iter in struct btrfs_io_bio when cloning
bios and use the helper __bio_for_each_segment with the saved bvec_iter to
access each bvec.
Also for dio reads which don't get split, we also need to save a copy of
bio iterator in btrfs_bio_clone to let __bio_for_each_segments to access
each bvec in dio read's endio. Note that it doesn't affect other calls of
btrfs_bio_clone() because they don't need to use this iterator.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/volumes.h')
-rw-r--r-- | fs/btrfs/volumes.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index 094521729df1..58b97b6f5f02 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h @@ -280,6 +280,7 @@ struct btrfs_io_bio { u8 csum_inline[BTRFS_BIO_INLINE_CSUM_SIZE]; u8 *csum_allocated; btrfs_io_bio_end_io_t *end_io; + struct bvec_iter iter; struct bio bio; }; |