aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2012-01-16 15:04:49 -0500
committerIlya Dryomov <idryomov@gmail.com>2012-01-16 15:04:49 -0500
commit837d5b6e46d1a4af5b6cc8f2fe83cb5de79a2961 (patch)
tree4ef87d05240e90480749c345274a83094caf66f0 /fs/btrfs/ctree.h
parent9555c6c180600b40f6e86bd4dc53bf47e06ed663 (diff)
Btrfs: allow for pausing restriper
Implement an ioctl for pausing restriper. This pauses the relocation, but balance is still considered to be "in progress": balance item is not deleted, other volume operations cannot be started, etc. If paused in the middle of profile changing operation we will continue making allocations with the target profile. Add a hook to close_ctree() to pause restriper and free its data structures on unmount. (It's safe to unmount when restriper is in "paused" state, we will resume with the same parameters on the next mount) Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 99eb2bcd9aa7..1afda75d5414 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -1214,7 +1214,10 @@ struct btrfs_fs_info {
1214 /* restriper state */ 1214 /* restriper state */
1215 spinlock_t balance_lock; 1215 spinlock_t balance_lock;
1216 struct mutex balance_mutex; 1216 struct mutex balance_mutex;
1217 atomic_t balance_running;
1218 atomic_t balance_pause_req;
1217 struct btrfs_balance_control *balance_ctl; 1219 struct btrfs_balance_control *balance_ctl;
1220 wait_queue_head_t balance_wait_q;
1218 1221
1219 unsigned data_chunk_allocations; 1222 unsigned data_chunk_allocations;
1220 unsigned metadata_ratio; 1223 unsigned metadata_ratio;
@@ -2658,6 +2661,7 @@ static inline int btrfs_fs_closing(struct btrfs_fs_info *fs_info)
2658} 2661}
2659static inline void free_fs_info(struct btrfs_fs_info *fs_info) 2662static inline void free_fs_info(struct btrfs_fs_info *fs_info)
2660{ 2663{
2664 kfree(fs_info->balance_ctl);
2661 kfree(fs_info->delayed_root); 2665 kfree(fs_info->delayed_root);
2662 kfree(fs_info->extent_root); 2666 kfree(fs_info->extent_root);
2663 kfree(fs_info->tree_root); 2667 kfree(fs_info->tree_root);