summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-checker.c
diff options
context:
space:
mode:
authorChengguang Xu <cgxu519@mykernel.net>2019-10-10 09:59:58 +0200
committerDavid Sterba <dsterba@suse.com>2019-11-18 12:46:55 +0100
commitb9b1a53e180e2ab4cea42c95bf344e4bf7f524e7 (patch)
tree1f85e9eb6f2b33ebf7a7e67a913e2192970babf0 /fs/btrfs/tree-checker.c
parentbtrfs: props: remove unnecessary hash_init() (diff)
downloadlinux-b9b1a53e180e2ab4cea42c95bf344e4bf7f524e7.tar.xz
linux-b9b1a53e180e2ab4cea42c95bf344e4bf7f524e7.zip
btrfs: use enum for extent type defines
Use enum to replace macro definitions of extent types. Signed-off-by: Chengguang Xu <cgxu519@mykernel.net> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/tree-checker.c')
-rw-r--r--fs/btrfs/tree-checker.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
index 8b6d4ccd010a..9699c91c958e 100644
--- a/fs/btrfs/tree-checker.c
+++ b/fs/btrfs/tree-checker.c
@@ -221,11 +221,11 @@ static int check_extent_data_item(struct extent_buffer *leaf,
fi = btrfs_item_ptr(leaf, slot, struct btrfs_file_extent_item);
- if (btrfs_file_extent_type(leaf, fi) > BTRFS_FILE_EXTENT_TYPES) {
+ if (btrfs_file_extent_type(leaf, fi) >= BTRFS_NR_FILE_EXTENT_TYPES) {
file_extent_err(leaf, slot,
"invalid type for file extent, have %u expect range [0, %u]",
btrfs_file_extent_type(leaf, fi),
- BTRFS_FILE_EXTENT_TYPES);
+ BTRFS_NR_FILE_EXTENT_TYPES - 1);
return -EUCLEAN;
}