Btrfs: cleanup for btrfs_btree_balance_dirty
- 'nr' is no more used. - btrfs_btree_balance_dirty() and __btrfs_btree_balance_dirty() can share a bunch of code. Signed-off-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
This commit is contained in:
@@ -952,7 +952,6 @@ int btrfs_defrag_root(struct btrfs_root *root, int cacheonly)
|
||||
struct btrfs_fs_info *info = root->fs_info;
|
||||
struct btrfs_trans_handle *trans;
|
||||
int ret;
|
||||
unsigned long nr;
|
||||
|
||||
if (xchg(&root->defrag_running, 1))
|
||||
return 0;
|
||||
@@ -964,9 +963,8 @@ int btrfs_defrag_root(struct btrfs_root *root, int cacheonly)
|
||||
|
||||
ret = btrfs_defrag_leaves(trans, root, cacheonly);
|
||||
|
||||
nr = trans->blocks_used;
|
||||
btrfs_end_transaction(trans, root);
|
||||
btrfs_btree_balance_dirty(info->tree_root, nr);
|
||||
btrfs_btree_balance_dirty(info->tree_root);
|
||||
cond_resched();
|
||||
|
||||
if (btrfs_fs_closing(root->fs_info) || ret != -EAGAIN)
|
||||
|
Reference in New Issue
Block a user