Re: [PATCH rcu] srcu: Guarantee non-negative return value from srcu_read_lock()

From: Christoph Hellwig
Date: Tue Oct 22 2024 - 03:13:20 EST


On Tue, Oct 22, 2024 at 09:10:18AM +0200, Peter Zijlstra wrote:
> Ah, well, the thing that got us here is that we (Andrii and me) wanted
> to use -1 as an 'invalid' value to indicate SRCU is not currently in
> use.
>
> So it all being int is really rather convenient :-)

Then please document that use. Maybe even with a symolic name for
-1 that clearly describes these uses.