Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH v4 2/3] nvmet: Export NVMe namespace attributes
Date: Fri, 28 Jun 2019 09:02:43 +0200	[thread overview]
Message-ID: <20190628070243.GB28268@lst.de> (raw)
In-Reply-To: <20190627143215.27443-3-bvanassche@acm.org>

On Thu, Jun 27, 2019@07:32:14AM -0700, Bart Van Assche wrote:
> +/* Convert a 32-bit number to a 16-bit 0's based number */
> +static __le16 to0based(u32 a)
> +{
> +	return cpu_to_le16(max(1U, min(1U << 16, a)) - 1);
> +}

Maybe lift this to drivers/nvme/target/nvmet.h as an inline as it
might be generally useful for more thing in the future?

> +	/*
> +	 * For NVMe 1.4 and later, bit 4 indicates that the fields NPWG,

I'd drop the NVMe 1.4 as it is a bit pointless.  Also in NVMe you
can generally implement the TPs on older compliance levels (which is in
fact what we do here anyway).

> +void nvmet_file_set_limits(struct file *file, struct nvme_id_ns *id)
> +{
> +	/*
> +	 * Since the file backend uses buffered I/O and since the NVMe spec
> +	 * does not allow to report that atomic commands are not supported by
> +	 * a namespace, do not set any of the namespace specific atomic
> +	 * properties. This will cause the initiator to rely on the atomic
> +	 * properties reported by the controller. To do: discuss whether or
> +	 * not the file backend should use direct I/O instead of buffered I/O.
> +	 */
> +}

This function doesn't seem overly helpful to me.  Can we just skip
that whole function and the comment?

  parent reply	other threads:[~2019-06-28  7:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-27 14:32 [PATCH v4 0/3] NVMe 1.4 Identify Namespace Support Bart Van Assche
2019-06-27 14:32 ` [PATCH v4 1/3] nvme: Introduce NVMe 1.4 Identify Namespace fields in struct nvme_id_ns Bart Van Assche
2019-06-28  7:00   ` Christoph Hellwig
2019-06-27 14:32 ` [PATCH v4 2/3] nvmet: Export NVMe namespace attributes Bart Van Assche
2019-06-27 17:11   ` Chaitanya Kulkarni
2019-06-28  7:02   ` Christoph Hellwig [this message]
2019-06-27 14:32 ` [PATCH v4 3/3] nvme: Set physical block size and optimal I/O size according to NVMe 1.4 Bart Van Assche
2019-06-28  7:06   ` Christoph Hellwig

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=20190628070243.GB28268@lst.de \
    --to=hch@lst.de \
    /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