linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Max Gurtovoy <mgurtovoy@nvidia.com>
To: Christoph Hellwig <hch@lst.de>, Keith Busch <kbusch@kernel.org>
Cc: Sagi Grimberg <sagi@grimberg.me>,
	linux-nvme@lists.infradead.org, oren@nvidia.com,
	chaitanyak@nvidia.com, linux-block@vger.kernel.org
Subject: Re: [PATCH v2 1/1] nvme: use macro definitions for setting reservation values
Date: Sun, 30 Oct 2022 02:35:32 +0200	[thread overview]
Message-ID: <6cb0e4dd-a5cd-86b6-ef25-c0ef7a44c5fb@nvidia.com> (raw)
In-Reply-To: <20221028083127.GB1043@lst.de>


On 10/28/2022 11:31 AM, Christoph Hellwig wrote:
> On Tue, Oct 25, 2022 at 05:09:21PM -0600, Keith Busch wrote:
>> As far as naming them goes, if the only usage is its definition, then
>> what's the point? If there's a use for a named enum somewhere else, then
>> yah, that improves readability.
> I think it is nice bit of documentation.  E.g. if the enum is for the
> bits or value in a nvme filed naming it after that field can be handy.

I also preferred my V1 with more documentation but was asked to remove it:

+/*
+ * Reservation Type Encoding
+ */
+enum {
+       NVME_PR_WRITE_EXCLUSIVE = 1, /* Write Exclusive Reservation */
+       NVME_PR_EXCLUSIVE_ACCESS = 2, /* Exclusive Access Reservation */
+       NVME_PR_WRITE_EXCLUSIVE_REG_ONLY = 3, /* Write Exclusive - 
Registrants Only Reservation */
+       NVME_PR_EXCLUSIVE_ACCESS_REG_ONLY = 4, /* Exclusive Access - 
Registrants Only Reservation */
+       NVME_PR_WRITE_EXCLUSIVE_ALL_REGS = 5, /* Write Exclusive - All 
Registrants Reservation */
+       NVME_PR_EXCLUSIVE_ACCESS_ALL_REGS = 6, /* Exclusive Access - All 
Registrants Reservation */
+};

regarding the naming of the enum I tend to agree that this is not a must 
here since this is currently the style of this header and since we use 
only its internal definitions.

So I'm ok we both v1 and v2.

We can do some work to improve the confusing enums in nvme.h but we need 
to agree on the strategy before we go implement.



  reply	other threads:[~2022-10-30  0:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-02  8:28 [PATCH v2 1/1] nvme: use macro definitions for setting reservation values Max Gurtovoy
2022-10-03 10:03 ` Sagi Grimberg
2022-10-03 10:16   ` Max Gurtovoy
2022-10-25 15:19     ` Christoph Hellwig
2022-10-25 23:09       ` Keith Busch
2022-10-28  8:31         ` Christoph Hellwig
2022-10-30  0:35           ` Max Gurtovoy [this message]
2022-10-25 23:20 ` Keith Busch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6cb0e4dd-a5cd-86b6-ef25-c0ef7a44c5fb@nvidia.com \
    --to=mgurtovoy@nvidia.com \
    --cc=chaitanyak@nvidia.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=oren@nvidia.com \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).