Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753335AbcJKPJl (ORCPT ); Tue, 11 Oct 2016 11:09:41 -0400 Received: from mail-qt0-f177.google.com ([209.85.216.177]:35840 "EHLO mail-qt0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751976AbcJKPJk (ORCPT ); Tue, 11 Oct 2016 11:09:40 -0400 MIME-Version: 1.0 In-Reply-To: References: <1475904515-24970-1-git-send-email-joelaf@google.com> <1475904515-24970-3-git-send-email-joelaf@google.com> From: Joel Fernandes Date: Tue, 11 Oct 2016 07:41:38 -0700 Message-ID: Subject: Re: [PATCH 2/7] pstore: locking: dont lock unless caller asks to To: Kees Cook Cc: LKML , Steven Rostedt , Anton Vorontsov , Colin Cross , Tony Luck Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 861 Lines: 23 On Mon, Oct 10, 2016 at 4:48 PM, Kees Cook wrote: > On Fri, Oct 7, 2016 at 10:28 PM, Joel Fernandes 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. Thanks, Joel