From 924452c80e81ba96bfc64847e983862016345381 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Sat, 29 Apr 2023 16:07:15 -0400 Subject: btrfs: extend btrfs_leaf_check to return btrfs_tree_block_status Instead of blanket returning -EUCLEAN for all the failures in btrfs_check_leaf, use btrfs_tree_block_status and return the appropriate status for each failure. Rename the helper to __btrfs_check_leaf and then make a wrapper of btrfs_check_leaf that will return -EUCLEAN to non-clean error codes. This will allow us to have the __btrfs_check_leaf variant in btrfs-progs while keeping the behavior in the kernel consistent. Signed-off-by: Josef Bacik Signed-off-by: David Sterba --- fs/btrfs/tree-checker.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'fs/btrfs/tree-checker.h') diff --git a/fs/btrfs/tree-checker.h b/fs/btrfs/tree-checker.h index 78ee2896423d..3b8de6d36141 100644 --- a/fs/btrfs/tree-checker.h +++ b/fs/btrfs/tree-checker.h @@ -53,6 +53,12 @@ enum btrfs_tree_block_status { BTRFS_TREE_BLOCK_INVALID_OWNER, }; +/* + * Exported simply for btrfs-progs which wants to have the + * btrfs_tree_block_status return codes. + */ +enum btrfs_tree_block_status __btrfs_check_leaf(struct extent_buffer *leaf); + int btrfs_check_leaf(struct extent_buffer *leaf); int btrfs_check_node(struct extent_buffer *node); -- cgit v1.2.3-73-gaa49b