diff options
author | Jan Schmidt <list.btrfs@jan-o-sch.net> | 2011-08-04 11:15:33 -0400 |
---|---|---|
committer | Jan Schmidt <list.btrfs@jan-o-sch.net> | 2011-09-29 07:38:42 -0400 |
commit | a1d3c4786a4b9c71c0767aa656a759968f7554b6 (patch) | |
tree | 1dc5596ca57f261d2816111e51a2f33928bbe4a6 /fs/btrfs/volumes.h | |
parent | d7728c960dccf775b92f2c4139f1216275a45c44 (diff) |
btrfs: btrfs_multi_bio replaced with btrfs_bio
btrfs_bio is a bio abstraction able to split and not complete after the last
bio has returned (like the old btrfs_multi_bio). Additionally, btrfs_bio
tracks the mirror_num used to read data which can be used for error
correction purposes.
Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Diffstat (limited to 'fs/btrfs/volumes.h')
-rw-r--r-- | fs/btrfs/volumes.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index 6d866db4e177..71f4f3f67495 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h | |||
@@ -136,7 +136,10 @@ struct btrfs_bio_stripe { | |||
136 | u64 length; /* only used for discard mappings */ | 136 | u64 length; /* only used for discard mappings */ |
137 | }; | 137 | }; |
138 | 138 | ||
139 | struct btrfs_multi_bio { | 139 | struct btrfs_bio; |
140 | typedef void (btrfs_bio_end_io_t) (struct btrfs_bio *bio, int err); | ||
141 | |||
142 | struct btrfs_bio { | ||
140 | atomic_t stripes_pending; | 143 | atomic_t stripes_pending; |
141 | bio_end_io_t *end_io; | 144 | bio_end_io_t *end_io; |
142 | struct bio *orig_bio; | 145 | struct bio *orig_bio; |
@@ -144,6 +147,7 @@ struct btrfs_multi_bio { | |||
144 | atomic_t error; | 147 | atomic_t error; |
145 | int max_errors; | 148 | int max_errors; |
146 | int num_stripes; | 149 | int num_stripes; |
150 | int mirror_num; | ||
147 | struct btrfs_bio_stripe stripes[]; | 151 | struct btrfs_bio_stripe stripes[]; |
148 | }; | 152 | }; |
149 | 153 | ||
@@ -171,7 +175,7 @@ struct map_lookup { | |||
171 | int btrfs_account_dev_extents_size(struct btrfs_device *device, u64 start, | 175 | int btrfs_account_dev_extents_size(struct btrfs_device *device, u64 start, |
172 | u64 end, u64 *length); | 176 | u64 end, u64 *length); |
173 | 177 | ||
174 | #define btrfs_multi_bio_size(n) (sizeof(struct btrfs_multi_bio) + \ | 178 | #define btrfs_bio_size(n) (sizeof(struct btrfs_bio) + \ |
175 | (sizeof(struct btrfs_bio_stripe) * (n))) | 179 | (sizeof(struct btrfs_bio_stripe) * (n))) |
176 | 180 | ||
177 | int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans, | 181 | int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans, |
@@ -180,7 +184,7 @@ int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans, | |||
180 | u64 chunk_offset, u64 start, u64 num_bytes); | 184 | u64 chunk_offset, u64 start, u64 num_bytes); |
181 | int btrfs_map_block(struct btrfs_mapping_tree *map_tree, int rw, | 185 | int btrfs_map_block(struct btrfs_mapping_tree *map_tree, int rw, |
182 | u64 logical, u64 *length, | 186 | u64 logical, u64 *length, |
183 | struct btrfs_multi_bio **multi_ret, int mirror_num); | 187 | struct btrfs_bio **bbio_ret, int mirror_num); |
184 | int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree, | 188 | int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree, |
185 | u64 chunk_start, u64 physical, u64 devid, | 189 | u64 chunk_start, u64 physical, u64 devid, |
186 | u64 **logical, int *naddrs, int *stripe_len); | 190 | u64 **logical, int *naddrs, int *stripe_len); |