btrfs: remove BTRFS_REF_LAST from btrfs_ref_type
PATCH 1/1 btrfs: remove BTRFS_REF_LAST from btrfs_ref_type
It seems that it has never been used, so remove it.
--- fs/btrfs/delayed-ref.h | 1 - 1 file changed, 1 deletion(-)
fs/btrfs/delayed-ref.h +0 -1
@@ -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
Quoted 1 line · Yangtao Li
It seems that it has never been used, so remove it.
History please.
Quoted 11 lines
Signed-off-by Yangtao Li <[email protected]>--- fs/btrfs/delayed-ref.h | 1 - 1 file changed, 1 deletion(-)fs/btrfs/delayed-ref.h +0
-0
fs/btrfs/delayed-ref.h enum btrfs_ref_type { · line 265
Quoted 4 lines
fs/btrfs/delayed-ref.h +0
-1@@ -262,7 +262,6 @@ enum btrfs_ref_type {BTRFS_REF_NOT_SET ,BTRFS_REF_DATA , BTRFS_REF_METADATA, - BTRFS_REF_LAST,
The _LAST or _NR suffix can be utilized to do sanity checks, and this is not part of the on-disk format.
And if this exposed by some automatic tools, please also mention it.
Quoted 3 lines
fs/btrfs/delayed-ref.h +0
-0} __packed;struct btrfs_ref {
Quoted 1 line
History please.
Did you mean change commit msg to below?
Commit b28b1f0ce44c ("btrfs: delayed-ref: Introduce better documented delayed ref structures") introduce BTRFS_REF_LAST but never use it, So let's remove it.
Quoted 1 line
The
_LASTor_NRsuffix can be utilized to do sanity checks, and this is not part of the on-disk format.
IIRC, delayed ref belongs to the extent tree memory kv cache.
Quoted 1 line
And if this exposed by some automatic tools, please also mention it.
I'm just looking at this code.
Thx,
Yangtao
Quoted 6 lines · 李扬韬
Quoted 1 line
History please.
Did you mean change commit msg to below?
Commit
b28b1f0ce44c("btrfs: delayed-ref: Introduce better documented delayed ref structures") introduceBTRFS_REF_LASTbut never use it, So let's remove it.
It's the common practice to leave a last entry for sanity checks.
But since it's not utilized for anything, I'm fine to remove it.
Quoted 11 lines
Quoted 2 lines
The
_LASTor_NRsuffix can be utilized to do sanity checks, and this is not part of the on-disk format.IIRC, delayed ref belongs to the extent tree memory kv cache.
Quoted 1 line
And if this exposed by some automatic tools, please also mention it.
I'm just looking at this code.
Thx,
Yangtao
Quoted 5 lines · Qu Wenruo
Quoted 2 lines · 李扬韬
Quoted 1 line
History please.
Quoted 8 lines
Quoted 4 lines
Did you mean change commit msg to below?
Commit
b28b1f0ce44c("btrfs: delayed-ref: Introduce better documented delayed ref structures") introduceBTRFS_REF_LASTbut never use it, So let's remove it.It's the common practice to leave a last entry for sanity checks.
But since it's not utilized for anything, I'm fine to remove it.
I think in this case it's ok to remove it, although I agree that we have the _LAST or _NR elsewhere. In btrfs_ref_type() tere's an assertion
ASSERT(ref->type == BTRFS_REF_DATA || ref->type == BTRFS_REF_METADATA);
which is validating the values. There's no enumeration or switch that could utilize the upper bound.
Quoted 5 lines
I think in this case it's ok to remove it, although I agree that we have the
_LASTor_NRelsewhere. Inbtrfs_ref_type()tere's an assertion
ASSERT(ref->type == BTRFS_REF_DATA || ref->type == BTRFS_REF_METADATA);which is validating the values. There's no enumeration or switch that could utilize the upper bound.
Do I need to modify the submission information and resend this patch?
Thx,
Yangtao
Quoted 7 lines · 李扬韬
Quoted 5 lines
I think in this case it's ok to remove it, although I agree that we have the
_LASTor_NRelsewhere. Inbtrfs_ref_type()tere's an assertion
ASSERT(ref->type == BTRFS_REF_DATA || ref->type == BTRFS_REF_METADATA);which is validating the values. There's no enumeration or switch that could utilize the upper bound.
Do I need to modify the submission information and resend this patch?
Yes please, the reasoning was missing from the original patch, we've come to a conclusion in the discussion so this should be summarized in v2.
Quoted 11 lines
Quoted 7 lines
Quoted 1 line
History please.
Did you mean change commit msg to below?
Commit
b28b1f0ce44c("btrfs: delayed-ref: Introduce better documented delayed ref structures") introduceBTRFS_REF_LASTbut never use it, So let's remove it.It's the common practice to leave a last entry for sanity checks.
But since it's not utilized for anything, I'm fine to remove it.
We can also add comments for all this kind of codes,
so that further readers will understand this common practice better.
Quoted 11 lines
Quoted 11 lines
Quoted 3 lines
The
_LASTor_NRsuffix can be utilized to do sanity checks, and this is not part of the on-disk format.> >IIRC, delayed ref belongs to the extent tree memory kv cache.
Quoted 1 line
And if this exposed by some automatic tools, please also mention it.
I'm just looking at this code.
Thx,
Yangtao