Re: [RESEND PATCH v4 03/10] lib/refcount: Remove unused refcount_*_checked() variants

From: David Sterba
Date: Thu Nov 21 2019 - 09:55:37 EST


On Thu, Nov 21, 2019 at 11:58:55AM +0000, Will Deacon wrote:
> The full-fat refcount implementation is exposed via a set of functions
> suffixed with "_checked()", the idea being that code can choose to use
> the more expensive, yet more secure implementation on a case-by-case
> basis.
>
> In reality, this hasn't happened, so with a grand total of zero users,
> let's remove the checked variants for now by simply dropping the suffix
> and predicating the out-of-line functions on CONFIG_REFCOUNT_FULL=y.

I am still interested in the _checked versions and have a WIP patch that
adds that to btrfs (that was my original plan) but haven't had enough
time to finalize it. The patch itself is simple, the missing part is to
understand and document what the saturated counters would do with the
structures.

If the _checked helpers are really bothering for you, then well remove
it, but I think it's a good API extension that makes the full-refcount
semantics independent of the config.