btrfs: remove BTRFS_REF_LAST from enum btrfs_ref_type
authorYangtao Li <frank.li@vivo.com>
Thu, 17 Apr 2025 14:26:49 +0000 (08:26 -0600)
committerDavid Sterba <dsterba@suse.com>
Thu, 15 May 2025 12:30:47 +0000 (14:30 +0200)
Commit b28b1f0ce44c ("btrfs: delayed-ref: Introduce better documented
delayed ref structures") introduced BTRFS_REF_LAST, which can be used
for sanity checking, e.g. in switch/case or for loops.

In btrfs_ref_type() there is an assertion

  ASSERT(ref->type == BTRFS_REF_DATA || ref->type == BTRFS_REF_METADATA);

to validate the values so we don't need the ending enum.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/delayed-ref.h

index f5ae880308d389f18ce46b68fc9cc1e36b669dd3..78cc2383761057fd2ac1af2c70e96d9c88597740 100644 (file)
@@ -262,7 +262,6 @@ enum btrfs_ref_type {
        BTRFS_REF_NOT_SET,
        BTRFS_REF_DATA,
        BTRFS_REF_METADATA,
-       BTRFS_REF_LAST,
 } __packed;
 
 struct btrfs_ref {