diff options
author | Liu Bo <bo.li.liu@oracle.com> | 2012-11-14 09:34:34 -0500 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2012-12-12 17:15:28 -0500 |
commit | b53d3f5db2b79637acadc06a330db6c2c60863f5 (patch) | |
tree | f5ad7a1612f413e1ae459eb88d20642972d6b02c /fs/btrfs/transaction.c | |
parent | 3ef5969cd8a42a78ccdbc53f7abb2e6136b2ec65 (diff) |
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>
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r-- | fs/btrfs/transaction.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index f21f39f0b1a..7b297354e73 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -952,7 +952,6 @@ int btrfs_defrag_root(struct btrfs_root *root, int cacheonly) | |||
952 | struct btrfs_fs_info *info = root->fs_info; | 952 | struct btrfs_fs_info *info = root->fs_info; |
953 | struct btrfs_trans_handle *trans; | 953 | struct btrfs_trans_handle *trans; |
954 | int ret; | 954 | int ret; |
955 | unsigned long nr; | ||
956 | 955 | ||
957 | if (xchg(&root->defrag_running, 1)) | 956 | if (xchg(&root->defrag_running, 1)) |
958 | return 0; | 957 | return 0; |
@@ -964,9 +963,8 @@ int btrfs_defrag_root(struct btrfs_root *root, int cacheonly) | |||
964 | 963 | ||
965 | ret = btrfs_defrag_leaves(trans, root, cacheonly); | 964 | ret = btrfs_defrag_leaves(trans, root, cacheonly); |
966 | 965 | ||
967 | nr = trans->blocks_used; | ||
968 | btrfs_end_transaction(trans, root); | 966 | btrfs_end_transaction(trans, root); |
969 | btrfs_btree_balance_dirty(info->tree_root, nr); | 967 | btrfs_btree_balance_dirty(info->tree_root); |
970 | cond_resched(); | 968 | cond_resched(); |
971 | 969 | ||
972 | if (btrfs_fs_closing(root->fs_info) || ret != -EAGAIN) | 970 | if (btrfs_fs_closing(root->fs_info) || ret != -EAGAIN) |