[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=whkx24ON4Ow0xkz-FSyb6nsZxxps5gEh7gCaSOvq4MNMw@mail.gmail.com>
Date: Tue, 7 Dec 2021 09:43:07 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Christoph Hellwig <hch@...radead.org>,
Jens Axboe <axboe@...nel.dk>,
"linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
Kees Cook <keescook@...omium.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] block: switch to atomic_t for request references
On Tue, Dec 7, 2021 at 8:52 AM Peter Zijlstra <peterz@...radead.org> wrote:
>
> How about we do something like the unsafe_ uaccess functions and do it
> like so?
Look ok by me, but I'd suggest simply making both error cases labels
in that case.
If somebody wants to distinguish them, it's easy to do, and if not you
can just use the same label.
Yes, it's a bit unusual, but once you start using labels for the
exceptional cases, why not do so consistently?
In the case of "dec_and_test" the "decrement to zero" case may not be
hugely exceptional, but if you do the same for "increment with
overflow protection" you do end up having the two different "zero vs
too big", so it would actually be more consistent, I think..
Linus
Powered by blists - more mailing lists