summaryrefslogtreecommitdiff
path: root/fs/btrfs/tree-checker.h
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2023-04-29 16:07:15 -0400
committerDavid Sterba <dsterba@suse.com>2023-06-19 13:59:25 +0200
commit924452c80e81ba96bfc64847e983862016345381 (patch)
tree63d7a6db5b453bbe4ce6b6b7c5e6e6aa109e7c82 /fs/btrfs/tree-checker.h
parentc8d5421563547a4b4ba6fcb9dae6b323dd02b75f (diff)
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 <josef@toxicpanda.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/tree-checker.h')
-rw-r--r--fs/btrfs/tree-checker.h6
1 files changed, 6 insertions, 0 deletions
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);