Skip to contentSkip to conversation

btrfs: remove BTRFS_REF_LAST from btrfs_ref_type

PATCH In review Yangtao Li 2 participants 2 messages Apr 17, 2025 – Apr 22, 2025 Btrfs file system

lore
Share & tools
lore

Yangtao Li

author
#0 lore raw

PATCH v2 1/1 btrfs: remove BTRFS_REF_LAST from btrfs_ref_type

Commit b28b1f0ce44c ("btrfs: delayed-ref: Introduce better documented delayed ref structures") introduced BTRFS_REF_LAST, which can be used for sanity checking.

In btrfs_ref_type() there was an assertion

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

to validate the value.

And there is currently no enum or switch to use the upper limit, so let's remove it.

---
 fs/btrfs/delayed-ref.h | 1 -
 1 file changed, 1 deletion(-)
fs/btrfs/delayed-ref.h +0 -1
index f5ae880308d3..78cc23837610 100644
@@ -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 {
Signature · 1 line
2.39.0
#1 lore raw
Quoted 6 lines · Yangtao Li

Commit b28b1f0ce44c ("btrfs: delayed-ref: Introduce better documented delayed ref structures") introduced BTRFS_REF_LAST, which can be used for sanity checking.

In btrfs_ref_type() there was an assertion

Quoted 8 lines

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

to validate the value.

And there is currently no enum or switch to use the upper limit, so let's remove it.

Added to for-next, thanks.