aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2012-01-16 15:04:48 -0500
committerIlya Dryomov <idryomov@gmail.com>2012-01-16 15:04:48 -0500
commit596410151ed71819b9e8a8018c6c9992796b256d (patch)
treeff697d01a6dd8cf50b37b3855e40764335be044d /fs/btrfs/disk-io.c
parent0940ebf6b92ea10a6f30ae5ac3993a3b75745da6 (diff)
Btrfs: recover balance on mount
On mount, if balance item is found, resume balance in a separate kernel thread. Try to be smart to continue roughly where previous balance (or convert) was interrupted. For chunk types that were being converted to some profile we turn on soft convert, in case of a simple balance we turn on usage filter and relocate only less-than-90%-full chunks of that type. These are just heuristics but they help quite a bit, and can be improved in future. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 190a1b24c902..eb7a11ac5b73 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -2427,6 +2427,10 @@ retry_root_backup:
2427 if (!err) 2427 if (!err)
2428 err = btrfs_orphan_cleanup(fs_info->tree_root); 2428 err = btrfs_orphan_cleanup(fs_info->tree_root);
2429 up_read(&fs_info->cleanup_work_sem); 2429 up_read(&fs_info->cleanup_work_sem);
2430
2431 if (!err)
2432 err = btrfs_recover_balance(fs_info->tree_root);
2433
2430 if (err) { 2434 if (err) {
2431 close_ctree(tree_root); 2435 close_ctree(tree_root);
2432 return ERR_PTR(err); 2436 return ERR_PTR(err);