[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250415160508.GH16750@suse.cz>
Date: Tue, 15 Apr 2025 18:05:08 +0200
From: David Sterba <dsterba@...e.cz>
To: Qu Wenruo <quwenruo.btrfs@....com>
Cc: 李扬韬 <frank.li@...o.com>, "clm@...com" <clm@...com>,
"josef@...icpanda.com" <josef@...icpanda.com>,
"dsterba@...e.com" <dsterba@...e.com>,
"linux-btrfs@...r.kernel.org" <linux-btrfs@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] btrfs: remove BTRFS_REF_LAST from btrfs_ref_type
On Tue, Apr 15, 2025 at 06:46:48PM +0930, Qu Wenruo wrote:
>
>
> 在 2025/4/15 18:26, 李扬韬 写道:
> >> 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.
>
> 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.
Powered by blists - more mailing lists