diff options
Diffstat (limited to 'fs/btrfs/volumes.h')
-rw-r--r-- | fs/btrfs/volumes.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index 6d866db4e177..ab5b1c49f352 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h | |||
@@ -92,6 +92,14 @@ struct btrfs_device { | |||
92 | struct btrfs_work work; | 92 | struct btrfs_work work; |
93 | struct rcu_head rcu; | 93 | struct rcu_head rcu; |
94 | struct work_struct rcu_work; | 94 | struct work_struct rcu_work; |
95 | |||
96 | /* readahead state */ | ||
97 | spinlock_t reada_lock; | ||
98 | atomic_t reada_in_flight; | ||
99 | u64 reada_next; | ||
100 | struct reada_zone *reada_curr_zone; | ||
101 | struct radix_tree_root reada_zones; | ||
102 | struct radix_tree_root reada_extents; | ||
95 | }; | 103 | }; |
96 | 104 | ||
97 | struct btrfs_fs_devices { | 105 | struct btrfs_fs_devices { |
@@ -136,7 +144,10 @@ struct btrfs_bio_stripe { | |||
136 | u64 length; /* only used for discard mappings */ | 144 | u64 length; /* only used for discard mappings */ |
137 | }; | 145 | }; |
138 | 146 | ||
139 | struct btrfs_multi_bio { | 147 | struct btrfs_bio; |
148 | typedef void (btrfs_bio_end_io_t) (struct btrfs_bio *bio, int err); | ||
149 | |||
150 | struct btrfs_bio { | ||
140 | atomic_t stripes_pending; | 151 | atomic_t stripes_pending; |
141 | bio_end_io_t *end_io; | 152 | bio_end_io_t *end_io; |
142 | struct bio *orig_bio; | 153 | struct bio *orig_bio; |
@@ -144,6 +155,7 @@ struct btrfs_multi_bio { | |||
144 | atomic_t error; | 155 | atomic_t error; |
145 | int max_errors; | 156 | int max_errors; |
146 | int num_stripes; | 157 | int num_stripes; |
158 | int mirror_num; | ||
147 | struct btrfs_bio_stripe stripes[]; | 159 | struct btrfs_bio_stripe stripes[]; |
148 | }; | 160 | }; |
149 | 161 | ||
@@ -171,7 +183,7 @@ struct map_lookup { | |||
171 | int btrfs_account_dev_extents_size(struct btrfs_device *device, u64 start, | 183 | int btrfs_account_dev_extents_size(struct btrfs_device *device, u64 start, |
172 | u64 end, u64 *length); | 184 | u64 end, u64 *length); |
173 | 185 | ||
174 | #define btrfs_multi_bio_size(n) (sizeof(struct btrfs_multi_bio) + \ | 186 | #define btrfs_bio_size(n) (sizeof(struct btrfs_bio) + \ |
175 | (sizeof(struct btrfs_bio_stripe) * (n))) | 187 | (sizeof(struct btrfs_bio_stripe) * (n))) |
176 | 188 | ||
177 | int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans, | 189 | int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans, |
@@ -180,7 +192,7 @@ int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans, | |||
180 | u64 chunk_offset, u64 start, u64 num_bytes); | 192 | u64 chunk_offset, u64 start, u64 num_bytes); |
181 | int btrfs_map_block(struct btrfs_mapping_tree *map_tree, int rw, | 193 | int btrfs_map_block(struct btrfs_mapping_tree *map_tree, int rw, |
182 | u64 logical, u64 *length, | 194 | u64 logical, u64 *length, |
183 | struct btrfs_multi_bio **multi_ret, int mirror_num); | 195 | struct btrfs_bio **bbio_ret, int mirror_num); |
184 | int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree, | 196 | int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree, |
185 | u64 chunk_start, u64 physical, u64 devid, | 197 | u64 chunk_start, u64 physical, u64 devid, |
186 | u64 **logical, int *naddrs, int *stripe_len); | 198 | u64 **logical, int *naddrs, int *stripe_len); |