@@ -307,9 +307,9 @@ enum btrfs_tree_block_status btrfs_check_block_for_repair(struct extent_buffer *
enum btrfs_tree_block_status status;
if (btrfs_is_leaf(eb))
- status = btrfs_check_leaf(first_key, eb);
+ status = btrfs_check_leaf(eb);
else
- status = btrfs_check_node(first_key, eb);
+ status = btrfs_check_node(eb);
if (status == BTRFS_TREE_BLOCK_CLEAN)
return status;
@@ -611,8 +611,7 @@ static void generic_err(const struct extent_buffer *buf, int slot,
fprintf(stderr, "\n");
}
-enum btrfs_tree_block_status
-btrfs_check_node(struct btrfs_key *parent_key, struct extent_buffer *node)
+enum btrfs_tree_block_status btrfs_check_node(struct extent_buffer *node)
{
struct btrfs_fs_info *fs_info = node->fs_info;
unsigned long nr = btrfs_header_nritems(node);
@@ -673,8 +672,7 @@ fail:
return ret;
}
-enum btrfs_tree_block_status
-btrfs_check_leaf(struct btrfs_key *parent_key, struct extent_buffer *leaf)
+enum btrfs_tree_block_status btrfs_check_leaf(struct extent_buffer *leaf)
{
struct btrfs_fs_info *fs_info = leaf->fs_info;
/* No valid key type is 0, so all key should be larger than this key */
@@ -781,21 +779,14 @@ fail:
static int noinline check_block(struct btrfs_fs_info *fs_info,
struct btrfs_path *path, int level)
{
- struct btrfs_key key;
- struct btrfs_key *parent_key_ptr = NULL;
enum btrfs_tree_block_status ret;
if (path->skip_check_block)
return 0;
- if (path->nodes[level + 1]) {
- btrfs_node_key_to_cpu(path->nodes[level + 1], &key,
- path->slots[level + 1]);
- parent_key_ptr = &key;
- }
if (level == 0)
- ret = btrfs_check_leaf(parent_key_ptr, path->nodes[0]);
+ ret = btrfs_check_leaf(path->nodes[0]);
else
- ret = btrfs_check_node(parent_key_ptr, path->nodes[level]);
+ ret = btrfs_check_node(path->nodes[level]);
if (ret == BTRFS_TREE_BLOCK_CLEAN)
return 0;
return -EIO;
@@ -2704,10 +2704,8 @@ int btrfs_convert_one_bg(struct btrfs_trans_handle *trans, u64 bytenr);
int btrfs_comp_cpu_keys(const struct btrfs_key *k1, const struct btrfs_key *k2);
int btrfs_del_ptr(struct btrfs_root *root, struct btrfs_path *path,
int level, int slot);
-enum btrfs_tree_block_status
-btrfs_check_node(struct btrfs_key *parent_key, struct extent_buffer *buf);
-enum btrfs_tree_block_status
-btrfs_check_leaf(struct btrfs_key *parent_key, struct extent_buffer *buf);
+enum btrfs_tree_block_status btrfs_check_node(struct extent_buffer *buf);
+enum btrfs_tree_block_status btrfs_check_leaf(struct extent_buffer *buf);
void reada_for_search(struct btrfs_fs_info *fs_info, struct btrfs_path *path,
int level, int slot, u64 objectid);
struct extent_buffer *read_node_slot(struct btrfs_fs_info *fs_info,
@@ -389,9 +389,9 @@ struct extent_buffer* read_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr,
* btrfs ins dump-tree.
*/
if (btrfs_header_level(eb))
- ret = btrfs_check_node(NULL, eb);
+ ret = btrfs_check_node(eb);
else
- ret = btrfs_check_leaf(NULL, eb);
+ ret = btrfs_check_leaf(eb);
if (!ret || candidate_mirror == mirror_num) {
btrfs_set_buffer_uptodate(eb);
return eb;
Now that this is unused by these helpers and only used by the repair related code we can remove this argument from the main helpers. Signed-off-by: Josef Bacik <josef@toxicpanda.com> --- check/repair.c | 4 ++-- kernel-shared/ctree.c | 17 ++++------------- kernel-shared/ctree.h | 6 ++---- kernel-shared/disk-io.c | 4 ++-- 4 files changed, 10 insertions(+), 21 deletions(-)