diff options
author | Liu Bo <bo.li.liu@oracle.com> | 2012-10-19 05:50:54 -0400 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2012-12-11 13:31:35 -0500 |
commit | 0e411ecec60138f22442728f036d38cfea007817 (patch) | |
tree | b065060d7073d38b98dd10c6a620d9a20d3e2c19 /fs/btrfs/ctree.c | |
parent | 6a7a665d78c5dd8bc76a010648c4e7d84517ab5a (diff) |
Btrfs: kill unnecessary arguments in del_ptr
The argument 'tree_mod_log' is not necessary since all of callers enable it.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r-- | fs/btrfs/ctree.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 4d518bd7751d..615b74968fab 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -38,8 +38,7 @@ static int balance_node_right(struct btrfs_trans_handle *trans, | |||
38 | struct extent_buffer *dst_buf, | 38 | struct extent_buffer *dst_buf, |
39 | struct extent_buffer *src_buf); | 39 | struct extent_buffer *src_buf); |
40 | static void del_ptr(struct btrfs_trans_handle *trans, struct btrfs_root *root, | 40 | static void del_ptr(struct btrfs_trans_handle *trans, struct btrfs_root *root, |
41 | struct btrfs_path *path, int level, int slot, | 41 | struct btrfs_path *path, int level, int slot); |
42 | int tree_mod_log); | ||
43 | static void tree_mod_log_free_eb(struct btrfs_fs_info *fs_info, | 42 | static void tree_mod_log_free_eb(struct btrfs_fs_info *fs_info, |
44 | struct extent_buffer *eb); | 43 | struct extent_buffer *eb); |
45 | struct extent_buffer *read_old_tree_block(struct btrfs_root *root, u64 bytenr, | 44 | struct extent_buffer *read_old_tree_block(struct btrfs_root *root, u64 bytenr, |
@@ -1827,7 +1826,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans, | |||
1827 | if (btrfs_header_nritems(right) == 0) { | 1826 | if (btrfs_header_nritems(right) == 0) { |
1828 | clean_tree_block(trans, root, right); | 1827 | clean_tree_block(trans, root, right); |
1829 | btrfs_tree_unlock(right); | 1828 | btrfs_tree_unlock(right); |
1830 | del_ptr(trans, root, path, level + 1, pslot + 1, 1); | 1829 | del_ptr(trans, root, path, level + 1, pslot + 1); |
1831 | root_sub_used(root, right->len); | 1830 | root_sub_used(root, right->len); |
1832 | btrfs_free_tree_block(trans, root, right, 0, 1); | 1831 | btrfs_free_tree_block(trans, root, right, 0, 1); |
1833 | free_extent_buffer_stale(right); | 1832 | free_extent_buffer_stale(right); |
@@ -1871,7 +1870,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans, | |||
1871 | if (btrfs_header_nritems(mid) == 0) { | 1870 | if (btrfs_header_nritems(mid) == 0) { |
1872 | clean_tree_block(trans, root, mid); | 1871 | clean_tree_block(trans, root, mid); |
1873 | btrfs_tree_unlock(mid); | 1872 | btrfs_tree_unlock(mid); |
1874 | del_ptr(trans, root, path, level + 1, pslot, 1); | 1873 | del_ptr(trans, root, path, level + 1, pslot); |
1875 | root_sub_used(root, mid->len); | 1874 | root_sub_used(root, mid->len); |
1876 | btrfs_free_tree_block(trans, root, mid, 0, 1); | 1875 | btrfs_free_tree_block(trans, root, mid, 0, 1); |
1877 | free_extent_buffer_stale(mid); | 1876 | free_extent_buffer_stale(mid); |
@@ -4602,14 +4601,13 @@ int btrfs_insert_item(struct btrfs_trans_handle *trans, struct btrfs_root | |||
4602 | * empty a node. | 4601 | * empty a node. |
4603 | */ | 4602 | */ |
4604 | static void del_ptr(struct btrfs_trans_handle *trans, struct btrfs_root *root, | 4603 | static void del_ptr(struct btrfs_trans_handle *trans, struct btrfs_root *root, |
4605 | struct btrfs_path *path, int level, int slot, | 4604 | struct btrfs_path *path, int level, int slot) |
4606 | int tree_mod_log) | ||
4607 | { | 4605 | { |
4608 | struct extent_buffer *parent = path->nodes[level]; | 4606 | struct extent_buffer *parent = path->nodes[level]; |
4609 | u32 nritems; | 4607 | u32 nritems; |
4610 | int ret; | 4608 | int ret; |
4611 | 4609 | ||
4612 | if (tree_mod_log && level) { | 4610 | if (level) { |
4613 | ret = tree_mod_log_insert_key(root->fs_info, parent, slot, | 4611 | ret = tree_mod_log_insert_key(root->fs_info, parent, slot, |
4614 | MOD_LOG_KEY_REMOVE); | 4612 | MOD_LOG_KEY_REMOVE); |
4615 | BUG_ON(ret < 0); | 4613 | BUG_ON(ret < 0); |
@@ -4617,7 +4615,7 @@ static void del_ptr(struct btrfs_trans_handle *trans, struct btrfs_root *root, | |||
4617 | 4615 | ||
4618 | nritems = btrfs_header_nritems(parent); | 4616 | nritems = btrfs_header_nritems(parent); |
4619 | if (slot != nritems - 1) { | 4617 | if (slot != nritems - 1) { |
4620 | if (tree_mod_log && level) | 4618 | if (level) |
4621 | tree_mod_log_eb_move(root->fs_info, parent, slot, | 4619 | tree_mod_log_eb_move(root->fs_info, parent, slot, |
4622 | slot + 1, nritems - slot - 1); | 4620 | slot + 1, nritems - slot - 1); |
4623 | memmove_extent_buffer(parent, | 4621 | memmove_extent_buffer(parent, |
@@ -4658,7 +4656,7 @@ static noinline void btrfs_del_leaf(struct btrfs_trans_handle *trans, | |||
4658 | struct extent_buffer *leaf) | 4656 | struct extent_buffer *leaf) |
4659 | { | 4657 | { |
4660 | WARN_ON(btrfs_header_generation(leaf) != trans->transid); | 4658 | WARN_ON(btrfs_header_generation(leaf) != trans->transid); |
4661 | del_ptr(trans, root, path, 1, path->slots[1], 1); | 4659 | del_ptr(trans, root, path, 1, path->slots[1]); |
4662 | 4660 | ||
4663 | /* | 4661 | /* |
4664 | * btrfs_free_extent is expensive, we want to make sure we | 4662 | * btrfs_free_extent is expensive, we want to make sure we |