diff mbox series

[16/18] btrfs-progs: rename btrfs_check_* to __btrfs_check_*

Message ID 303808c223f223704d0f06e8d9ff115a19a119c4.1681939316.git.josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: more prep work for syncing ctree.c | expand

Commit Message

Josef Bacik April 19, 2023, 9:24 p.m. UTC
These helpers are called __btrfs_check_* in the kernel as they return
the special enum to indicate what part of the leaf/node failed.  Rename
the uses in btrfs-progs to match the kernel naming convention to make it
easier to sync that code.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 check/repair.c          | 4 ++--
 kernel-shared/ctree.c   | 8 ++++----
 kernel-shared/ctree.h   | 4 ++--
 kernel-shared/disk-io.c | 4 ++--
 4 files changed, 10 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/check/repair.c b/check/repair.c
index ec8b0196..b323ad3e 100644
--- a/check/repair.c
+++ b/check/repair.c
@@ -311,9 +311,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(eb);
+		status = __btrfs_check_leaf(eb);
 	else
-		status = btrfs_check_node(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 3e1085a0..66f44879 100644
--- a/kernel-shared/ctree.c
+++ b/kernel-shared/ctree.c
@@ -616,7 +616,7 @@  static void generic_err(const struct extent_buffer *buf, int slot,
 	fprintf(stderr, "\n");
 }
 
-enum btrfs_tree_block_status btrfs_check_node(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);
@@ -677,7 +677,7 @@  fail:
 	return ret;
 }
 
-enum btrfs_tree_block_status btrfs_check_leaf(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 */
@@ -789,9 +789,9 @@  static int noinline check_block(struct btrfs_fs_info *fs_info,
 	if (path->skip_check_block)
 		return 0;
 	if (level == 0)
-		ret = btrfs_check_leaf(path->nodes[0]);
+		ret = __btrfs_check_leaf(path->nodes[0]);
 	else
-		ret = btrfs_check_node(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 20c9edc6..237f530d 100644
--- a/kernel-shared/ctree.h
+++ b/kernel-shared/ctree.h
@@ -958,8 +958,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 extent_buffer *buf);
-enum btrfs_tree_block_status btrfs_check_leaf(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);
 struct extent_buffer *read_node_slot(struct btrfs_fs_info *fs_info,
 				   struct extent_buffer *parent, int slot);
 int btrfs_previous_item(struct btrfs_root *root,
diff --git a/kernel-shared/disk-io.c b/kernel-shared/disk-io.c
index 6e810bd1..4950c685 100644
--- a/kernel-shared/disk-io.c
+++ b/kernel-shared/disk-io.c
@@ -370,9 +370,9 @@  int btrfs_read_extent_buffer(struct extent_buffer *eb, u64 parent_transid,
 			 * btrfs ins dump-tree.
 			 */
 			if (btrfs_header_level(eb))
-				ret = btrfs_check_node(eb);
+				ret = __btrfs_check_node(eb);
 			else
-				ret = btrfs_check_leaf(eb);
+				ret = __btrfs_check_leaf(eb);
 			if (!ret || candidate_mirror == mirror_num) {
 				btrfs_set_buffer_uptodate(eb);
 				return 0;