aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/volumes.h')
-rw-r--r--fs/btrfs/volumes.h21
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
152struct map_lookup { 153struct 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) */
167int 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 */
173static 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
181int btrfs_account_dev_extents_size(struct btrfs_device *device, u64 start, 167int 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);
202void btrfs_mapping_tree_free(struct btrfs_mapping_tree *tree); 188void btrfs_mapping_tree_free(struct btrfs_mapping_tree *tree);
203int btrfs_map_bio(struct btrfs_root *root, int rw, struct bio *bio, 189int 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);
205int btrfs_read_super_device(struct btrfs_root *root, struct extent_buffer *buf);
206int btrfs_open_devices(struct btrfs_fs_devices *fs_devices, 191int btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
207 fmode_t flags, void *holder); 192 fmode_t flags, void *holder);
208int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder, 193int 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,
215int btrfs_rm_device(struct btrfs_root *root, char *device_path); 200int btrfs_rm_device(struct btrfs_root *root, char *device_path);
216int btrfs_cleanup_fs_uuids(void); 201int btrfs_cleanup_fs_uuids(void);
217int btrfs_num_copies(struct btrfs_mapping_tree *map_tree, u64 logical, u64 len); 202int btrfs_num_copies(struct btrfs_mapping_tree *map_tree, u64 logical, u64 len);
218int btrfs_unplug_page(struct btrfs_mapping_tree *map_tree,
219 u64 logical, struct page *page);
220int btrfs_grow_device(struct btrfs_trans_handle *trans, 203int btrfs_grow_device(struct btrfs_trans_handle *trans,
221 struct btrfs_device *device, u64 new_size); 204 struct btrfs_device *device, u64 new_size);
222struct btrfs_device *btrfs_find_device(struct btrfs_root *root, u64 devid, 205struct 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,
224int btrfs_shrink_device(struct btrfs_device *device, u64 new_size); 207int btrfs_shrink_device(struct btrfs_device *device, u64 new_size);
225int btrfs_init_new_device(struct btrfs_root *root, char *path); 208int btrfs_init_new_device(struct btrfs_root *root, char *path);
226int btrfs_balance(struct btrfs_root *dev_root); 209int btrfs_balance(struct btrfs_root *dev_root);
227void btrfs_unlock_volumes(void);
228void btrfs_lock_volumes(void);
229int btrfs_chunk_readonly(struct btrfs_root *root, u64 chunk_offset); 210int btrfs_chunk_readonly(struct btrfs_root *root, u64 chunk_offset);
230int find_free_dev_extent(struct btrfs_trans_handle *trans, 211int 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,