diff options
Diffstat (limited to 'fs/btrfs/volumes.h')
-rw-r--r-- | fs/btrfs/volumes.h | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index f7c20123a1f..7c58a7b2d99 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h | |||
@@ -147,6 +147,7 @@ struct btrfs_device_info { | |||
147 | struct btrfs_device *dev; | 147 | struct btrfs_device *dev; |
148 | u64 dev_offset; | 148 | u64 dev_offset; |
149 | u64 max_avail; | 149 | u64 max_avail; |
150 | u64 total_avail; | ||
150 | }; | 151 | }; |
151 | 152 | ||
152 | struct map_lookup { | 153 | struct map_lookup { |
@@ -163,21 +164,6 @@ struct map_lookup { | |||
163 | #define map_lookup_size(n) (sizeof(struct map_lookup) + \ | 164 | #define map_lookup_size(n) (sizeof(struct map_lookup) + \ |
164 | (sizeof(struct btrfs_bio_stripe) * (n))) | 165 | (sizeof(struct btrfs_bio_stripe) * (n))) |
165 | 166 | ||
166 | /* Used to sort the devices by max_avail(descending sort) */ | ||
167 | int btrfs_cmp_device_free_bytes(const void *dev_info1, const void *dev_info2); | ||
168 | |||
169 | /* | ||
170 | * sort the devices by max_avail, in which max free extent size of each device | ||
171 | * is stored.(Descending Sort) | ||
172 | */ | ||
173 | static inline void btrfs_descending_sort_devices( | ||
174 | struct btrfs_device_info *devices, | ||
175 | size_t nr_devices) | ||
176 | { | ||
177 | sort(devices, nr_devices, sizeof(struct btrfs_device_info), | ||
178 | btrfs_cmp_device_free_bytes, NULL); | ||
179 | } | ||
180 | |||
181 | int btrfs_account_dev_extents_size(struct btrfs_device *device, u64 start, | 167 | int btrfs_account_dev_extents_size(struct btrfs_device *device, u64 start, |
182 | u64 end, u64 *length); | 168 | u64 end, u64 *length); |
183 | 169 | ||
@@ -202,7 +188,6 @@ void btrfs_mapping_init(struct btrfs_mapping_tree *tree); | |||
202 | void btrfs_mapping_tree_free(struct btrfs_mapping_tree *tree); | 188 | void btrfs_mapping_tree_free(struct btrfs_mapping_tree *tree); |
203 | int btrfs_map_bio(struct btrfs_root *root, int rw, struct bio *bio, | 189 | int btrfs_map_bio(struct btrfs_root *root, int rw, struct bio *bio, |
204 | int mirror_num, int async_submit); | 190 | int mirror_num, int async_submit); |
205 | int btrfs_read_super_device(struct btrfs_root *root, struct extent_buffer *buf); | ||
206 | int btrfs_open_devices(struct btrfs_fs_devices *fs_devices, | 191 | int btrfs_open_devices(struct btrfs_fs_devices *fs_devices, |
207 | fmode_t flags, void *holder); | 192 | fmode_t flags, void *holder); |
208 | int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder, | 193 | int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder, |
@@ -215,8 +200,6 @@ int btrfs_add_device(struct btrfs_trans_handle *trans, | |||
215 | int btrfs_rm_device(struct btrfs_root *root, char *device_path); | 200 | int btrfs_rm_device(struct btrfs_root *root, char *device_path); |
216 | int btrfs_cleanup_fs_uuids(void); | 201 | int btrfs_cleanup_fs_uuids(void); |
217 | int btrfs_num_copies(struct btrfs_mapping_tree *map_tree, u64 logical, u64 len); | 202 | int btrfs_num_copies(struct btrfs_mapping_tree *map_tree, u64 logical, u64 len); |
218 | int btrfs_unplug_page(struct btrfs_mapping_tree *map_tree, | ||
219 | u64 logical, struct page *page); | ||
220 | int btrfs_grow_device(struct btrfs_trans_handle *trans, | 203 | int btrfs_grow_device(struct btrfs_trans_handle *trans, |
221 | struct btrfs_device *device, u64 new_size); | 204 | struct btrfs_device *device, u64 new_size); |
222 | struct btrfs_device *btrfs_find_device(struct btrfs_root *root, u64 devid, | 205 | struct btrfs_device *btrfs_find_device(struct btrfs_root *root, u64 devid, |
@@ -224,8 +207,6 @@ struct btrfs_device *btrfs_find_device(struct btrfs_root *root, u64 devid, | |||
224 | int btrfs_shrink_device(struct btrfs_device *device, u64 new_size); | 207 | int btrfs_shrink_device(struct btrfs_device *device, u64 new_size); |
225 | int btrfs_init_new_device(struct btrfs_root *root, char *path); | 208 | int btrfs_init_new_device(struct btrfs_root *root, char *path); |
226 | int btrfs_balance(struct btrfs_root *dev_root); | 209 | int btrfs_balance(struct btrfs_root *dev_root); |
227 | void btrfs_unlock_volumes(void); | ||
228 | void btrfs_lock_volumes(void); | ||
229 | int btrfs_chunk_readonly(struct btrfs_root *root, u64 chunk_offset); | 210 | int btrfs_chunk_readonly(struct btrfs_root *root, u64 chunk_offset); |
230 | int find_free_dev_extent(struct btrfs_trans_handle *trans, | 211 | int find_free_dev_extent(struct btrfs_trans_handle *trans, |
231 | struct btrfs_device *device, u64 num_bytes, | 212 | struct btrfs_device *device, u64 num_bytes, |