diff mbox series

[11/11] btrfs-progs: remove parent_key arg from btrfs_check_* helpers

Message ID c5adf830ca98fe359105d216dff330de53ae4c55.1681938648.git.josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: prep work for syncing files into kernel-shared | expand

Commit Message

Josef Bacik April 19, 2023, 9:13 p.m. UTC
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(-)
diff mbox series

Patch

diff --git a/check/repair.c b/check/repair.c
index 71b2a277..8c1e2027 100644
--- a/check/repair.c
+++ b/check/repair.c
@@ -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;
diff --git a/kernel-shared/ctree.c b/kernel-shared/ctree.c
index c1c2059b..911ec51c 100644
--- a/kernel-shared/ctree.c
+++ b/kernel-shared/ctree.c
@@ -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;
diff --git a/kernel-shared/ctree.h b/kernel-shared/ctree.h
index 13264387..d81d7c02 100644
--- a/kernel-shared/ctree.h
+++ b/kernel-shared/ctree.h
@@ -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,
diff --git a/kernel-shared/disk-io.c b/kernel-shared/disk-io.c
index b5ad89c2..7d165720 100644
--- a/kernel-shared/disk-io.c
+++ b/kernel-shared/disk-io.c
@@ -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;