diff options
Diffstat (limited to 'fs/btrfs/volumes.h')
-rw-r--r-- | fs/btrfs/volumes.h | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index 53c06af92e8d..d3c3939ac751 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h | |||
@@ -50,6 +50,7 @@ struct btrfs_device { | |||
50 | int in_fs_metadata; | 50 | int in_fs_metadata; |
51 | int missing; | 51 | int missing; |
52 | int can_discard; | 52 | int can_discard; |
53 | int is_tgtdev_for_dev_replace; | ||
53 | 54 | ||
54 | spinlock_t io_lock; | 55 | spinlock_t io_lock; |
55 | 56 | ||
@@ -88,7 +89,7 @@ struct btrfs_device { | |||
88 | u8 uuid[BTRFS_UUID_SIZE]; | 89 | u8 uuid[BTRFS_UUID_SIZE]; |
89 | 90 | ||
90 | /* per-device scrub information */ | 91 | /* per-device scrub information */ |
91 | struct scrub_dev *scrub_device; | 92 | struct scrub_ctx *scrub_device; |
92 | 93 | ||
93 | struct btrfs_work work; | 94 | struct btrfs_work work; |
94 | struct rcu_head rcu; | 95 | struct rcu_head rcu; |
@@ -179,6 +180,15 @@ struct btrfs_device_info { | |||
179 | u64 total_avail; | 180 | u64 total_avail; |
180 | }; | 181 | }; |
181 | 182 | ||
183 | struct btrfs_raid_attr { | ||
184 | int sub_stripes; /* sub_stripes info for map */ | ||
185 | int dev_stripes; /* stripes per dev */ | ||
186 | int devs_max; /* max devs to use */ | ||
187 | int devs_min; /* min devs needed */ | ||
188 | int devs_increment; /* ndevs has to be a multiple of this */ | ||
189 | int ncopies; /* how many copies to data has */ | ||
190 | }; | ||
191 | |||
182 | struct map_lookup { | 192 | struct map_lookup { |
183 | u64 type; | 193 | u64 type; |
184 | int io_align; | 194 | int io_align; |
@@ -248,7 +258,7 @@ int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans, | |||
248 | struct btrfs_device *device, | 258 | struct btrfs_device *device, |
249 | u64 chunk_tree, u64 chunk_objectid, | 259 | u64 chunk_tree, u64 chunk_objectid, |
250 | u64 chunk_offset, u64 start, u64 num_bytes); | 260 | u64 chunk_offset, u64 start, u64 num_bytes); |
251 | int btrfs_map_block(struct btrfs_mapping_tree *map_tree, int rw, | 261 | int btrfs_map_block(struct btrfs_fs_info *fs_info, int rw, |
252 | u64 logical, u64 *length, | 262 | u64 logical, u64 *length, |
253 | struct btrfs_bio **bbio_ret, int mirror_num); | 263 | struct btrfs_bio **bbio_ret, int mirror_num); |
254 | int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree, | 264 | int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree, |
@@ -267,19 +277,27 @@ int btrfs_open_devices(struct btrfs_fs_devices *fs_devices, | |||
267 | int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder, | 277 | int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder, |
268 | struct btrfs_fs_devices **fs_devices_ret); | 278 | struct btrfs_fs_devices **fs_devices_ret); |
269 | int btrfs_close_devices(struct btrfs_fs_devices *fs_devices); | 279 | int btrfs_close_devices(struct btrfs_fs_devices *fs_devices); |
270 | void btrfs_close_extra_devices(struct btrfs_fs_devices *fs_devices); | 280 | void btrfs_close_extra_devices(struct btrfs_fs_info *fs_info, |
281 | struct btrfs_fs_devices *fs_devices, int step); | ||
282 | int btrfs_find_device_missing_or_by_path(struct btrfs_root *root, | ||
283 | char *device_path, | ||
284 | struct btrfs_device **device); | ||
285 | int btrfs_find_device_by_path(struct btrfs_root *root, char *device_path, | ||
286 | struct btrfs_device **device); | ||
271 | int btrfs_add_device(struct btrfs_trans_handle *trans, | 287 | int btrfs_add_device(struct btrfs_trans_handle *trans, |
272 | struct btrfs_root *root, | 288 | struct btrfs_root *root, |
273 | struct btrfs_device *device); | 289 | struct btrfs_device *device); |
274 | int btrfs_rm_device(struct btrfs_root *root, char *device_path); | 290 | int btrfs_rm_device(struct btrfs_root *root, char *device_path); |
275 | void btrfs_cleanup_fs_uuids(void); | 291 | void btrfs_cleanup_fs_uuids(void); |
276 | int btrfs_num_copies(struct btrfs_mapping_tree *map_tree, u64 logical, u64 len); | 292 | int btrfs_num_copies(struct btrfs_fs_info *fs_info, u64 logical, u64 len); |
277 | int btrfs_grow_device(struct btrfs_trans_handle *trans, | 293 | int btrfs_grow_device(struct btrfs_trans_handle *trans, |
278 | struct btrfs_device *device, u64 new_size); | 294 | struct btrfs_device *device, u64 new_size); |
279 | struct btrfs_device *btrfs_find_device(struct btrfs_root *root, u64 devid, | 295 | struct btrfs_device *btrfs_find_device(struct btrfs_fs_info *fs_info, u64 devid, |
280 | u8 *uuid, u8 *fsid); | 296 | u8 *uuid, u8 *fsid); |
281 | int btrfs_shrink_device(struct btrfs_device *device, u64 new_size); | 297 | int btrfs_shrink_device(struct btrfs_device *device, u64 new_size); |
282 | int btrfs_init_new_device(struct btrfs_root *root, char *path); | 298 | int btrfs_init_new_device(struct btrfs_root *root, char *path); |
299 | int btrfs_init_dev_replace_tgtdev(struct btrfs_root *root, char *device_path, | ||
300 | struct btrfs_device **device_out); | ||
283 | int btrfs_balance(struct btrfs_balance_control *bctl, | 301 | int btrfs_balance(struct btrfs_balance_control *bctl, |
284 | struct btrfs_ioctl_balance_args *bargs); | 302 | struct btrfs_ioctl_balance_args *bargs); |
285 | int btrfs_resume_balance_async(struct btrfs_fs_info *fs_info); | 303 | int btrfs_resume_balance_async(struct btrfs_fs_info *fs_info); |
@@ -296,6 +314,13 @@ int btrfs_get_dev_stats(struct btrfs_root *root, | |||
296 | int btrfs_init_dev_stats(struct btrfs_fs_info *fs_info); | 314 | int btrfs_init_dev_stats(struct btrfs_fs_info *fs_info); |
297 | int btrfs_run_dev_stats(struct btrfs_trans_handle *trans, | 315 | int btrfs_run_dev_stats(struct btrfs_trans_handle *trans, |
298 | struct btrfs_fs_info *fs_info); | 316 | struct btrfs_fs_info *fs_info); |
317 | void btrfs_rm_dev_replace_srcdev(struct btrfs_fs_info *fs_info, | ||
318 | struct btrfs_device *srcdev); | ||
319 | void btrfs_destroy_dev_replace_tgtdev(struct btrfs_fs_info *fs_info, | ||
320 | struct btrfs_device *tgtdev); | ||
321 | void btrfs_init_dev_replace_tgtdev_for_resume(struct btrfs_fs_info *fs_info, | ||
322 | struct btrfs_device *tgtdev); | ||
323 | int btrfs_scratch_superblock(struct btrfs_device *device); | ||
299 | 324 | ||
300 | static inline void btrfs_dev_stat_inc(struct btrfs_device *dev, | 325 | static inline void btrfs_dev_stat_inc(struct btrfs_device *dev, |
301 | int index) | 326 | int index) |