Skip to content

Commit a7b4e6c

Browse files
josefbacikkdave
authored andcommitted
btrfs: add btrfs_tree_block_status definitions to tree-checker.h
We use this in btrfs-progs to determine if we can fix different types of corruptions. We don't care about this in the kernel, however it would be good to share this code between the kernel and btrfs-progs, so add the status definitions so we can start converting the tree-checker code over to using these status flags instead of blanket returning -EUCLEAN. Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Josef Bacik <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 85d8a82 commit a7b4e6c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

fs/btrfs/tree-checker.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,19 @@ struct btrfs_tree_parent_check {
4040
u8 level;
4141
};
4242

43+
enum btrfs_tree_block_status {
44+
BTRFS_TREE_BLOCK_CLEAN,
45+
BTRFS_TREE_BLOCK_INVALID_NRITEMS,
46+
BTRFS_TREE_BLOCK_INVALID_PARENT_KEY,
47+
BTRFS_TREE_BLOCK_BAD_KEY_ORDER,
48+
BTRFS_TREE_BLOCK_INVALID_LEVEL,
49+
BTRFS_TREE_BLOCK_INVALID_FREE_SPACE,
50+
BTRFS_TREE_BLOCK_INVALID_OFFSETS,
51+
BTRFS_TREE_BLOCK_INVALID_BLOCKPTR,
52+
BTRFS_TREE_BLOCK_INVALID_ITEM,
53+
BTRFS_TREE_BLOCK_INVALID_OWNER,
54+
};
55+
4356
int btrfs_check_leaf(struct extent_buffer *leaf);
4457
int btrfs_check_node(struct extent_buffer *node);
4558

0 commit comments

Comments
 (0)