Re: [PATCH 2/7] pstore: locking: dont lock unless caller asks to
From: Joel Fernandes
Date: Tue Oct 11 2016 - 11:09:44 EST
On Mon, Oct 10, 2016 at 4:48 PM, Kees Cook <keescook@xxxxxxxxxxxx> wrote:
> On Fri, Oct 7, 2016 at 10:28 PM, Joel Fernandes <joelaf@xxxxxxxxxx> wrote:
>> In preparation of not locking at all for certain buffers depending on if
>> there's contention, make locking optional depending if caller requested it.
> This should be a bool argument (or enum), with named values so it's
> more readable. For example, these don't immediately tell me what the
> argument does:
> persistent_ram_write(cxt->cprz, buf, size, 1);
> persistent_ram_write(cxt->cprz, buf, size, true);
> But this does:
> persistent_ram_write(cxt->cprz, buf, size, PSTORE_REQUIRE_LOCKING);
> As part of this, can you document in the pstore structure which types
> of front-ends require locking and if they don't, why?
Sure, I will make it more descriptive as you suggested.