diff options
Diffstat (limited to 'fs/btrfs/volumes.h')
-rw-r--r-- | fs/btrfs/volumes.h | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index 6d866db4e17..78f2d4d4f37 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h | |||
@@ -92,6 +92,20 @@ 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; | ||
103 | |||
104 | /* for sending down flush barriers */ | ||
105 | struct bio *flush_bio; | ||
106 | struct completion flush_wait; | ||
107 | int nobarriers; | ||
108 | |||
95 | }; | 109 | }; |
96 | 110 | ||
97 | struct btrfs_fs_devices { | 111 | struct btrfs_fs_devices { |
@@ -136,7 +150,10 @@ struct btrfs_bio_stripe { | |||
136 | u64 length; /* only used for discard mappings */ | 150 | u64 length; /* only used for discard mappings */ |
137 | }; | 151 | }; |
138 | 152 | ||
139 | struct btrfs_multi_bio { | 153 | struct btrfs_bio; |
154 | typedef void (btrfs_bio_end_io_t) (struct btrfs_bio *bio, int err); | ||
155 | |||
156 | struct btrfs_bio { | ||
140 | atomic_t stripes_pending; | 157 | atomic_t stripes_pending; |
141 | bio_end_io_t *end_io; | 158 | bio_end_io_t *end_io; |
142 | struct bio *orig_bio; | 159 | struct bio *orig_bio; |
@@ -144,6 +161,7 @@ struct btrfs_multi_bio { | |||
144 | atomic_t error; | 161 | atomic_t error; |
145 | int max_errors; | 162 | int max_errors; |
146 | int num_stripes; | 163 | int num_stripes; |
164 | int mirror_num; | ||
147 | struct btrfs_bio_stripe stripes[]; | 165 | struct btrfs_bio_stripe stripes[]; |
148 | }; | 166 | }; |
149 | 167 | ||
@@ -171,7 +189,7 @@ struct map_lookup { | |||
171 | int btrfs_account_dev_extents_size(struct btrfs_device *device, u64 start, | 189 | int btrfs_account_dev_extents_size(struct btrfs_device *device, u64 start, |
172 | u64 end, u64 *length); | 190 | u64 end, u64 *length); |
173 | 191 | ||
174 | #define btrfs_multi_bio_size(n) (sizeof(struct btrfs_multi_bio) + \ | 192 | #define btrfs_bio_size(n) (sizeof(struct btrfs_bio) + \ |
175 | (sizeof(struct btrfs_bio_stripe) * (n))) | 193 | (sizeof(struct btrfs_bio_stripe) * (n))) |
176 | 194 | ||
177 | int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans, | 195 | int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans, |
@@ -180,7 +198,7 @@ int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans, | |||
180 | u64 chunk_offset, u64 start, u64 num_bytes); | 198 | u64 chunk_offset, u64 start, u64 num_bytes); |
181 | int btrfs_map_block(struct btrfs_mapping_tree *map_tree, int rw, | 199 | int btrfs_map_block(struct btrfs_mapping_tree *map_tree, int rw, |
182 | u64 logical, u64 *length, | 200 | u64 logical, u64 *length, |
183 | struct btrfs_multi_bio **multi_ret, int mirror_num); | 201 | struct btrfs_bio **bbio_ret, int mirror_num); |
184 | int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree, | 202 | int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree, |
185 | u64 chunk_start, u64 physical, u64 devid, | 203 | u64 chunk_start, u64 physical, u64 devid, |
186 | u64 **logical, int *naddrs, int *stripe_len); | 204 | u64 **logical, int *naddrs, int *stripe_len); |