linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: hch@infradead.org (Christoph Hellwig)
Subject: [PATCH] nvmet-loop: use nr_phys_segments when map rq to sgl
Date: Fri, 18 May 2018 02:09:23 -0700	[thread overview]
Message-ID: <20180518090923.GA31336@infradead.org> (raw)
In-Reply-To: <CAK0tqinRpkb5JQY8W4jSA2onOHXbmnrzH8jOP8BGjfScmTJ1eg@mail.gmail.com>

On Mon, May 14, 2018@03:17:51PM -0700, chaitany kulkarni wrote:
> +static inline void nvme_setup_write_zeroes(struct nvme_ns *ns,
> +               struct request *req, struct nvme_command *cmnd)
> +{
> +       struct nvme_write_zeroes_cmd *write_zeroes = &cmnd->write_zeroes;
> +
> +       memset(cmnd, 0, sizeof(*cmnd));
> +       write_zeroes->opcode = nvme_cmd_write_zeroes;
> +       write_zeroes->nsid = cpu_to_le32(ns->head->ns_id);
> +       write_zeroes->slba =
> +               cpu_to_le64(nvme_block_nr(ns, blk_rq_pos(req)));
> +       write_zeroes->length =
> +               cpu_to_le16((blk_rq_bytes(req) >> ns->lba_shift) - 1);
> +       write_zeroes->control = 0;
> +}

This doesn't even set RQF_SPECIAL_PAYLOAD, so that is not the issue.

Actually reviewing things again I think your original patch is fine
as it actually uses blk_rq_nr_phys_segments() which checks
RQF_SPECIAL_PAYLOAD.

  reply	other threads:[~2018-05-18  9:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-11  6:38 [PATCH] nvmet-loop: use nr_phys_segments when map rq to sgl Chaitanya Kulkarni
2018-05-14  8:32 ` Christoph Hellwig
2018-05-14 22:17   ` chaitany kulkarni
2018-05-18  9:09     ` Christoph Hellwig [this message]
2018-05-18  9:09 ` Christoph Hellwig
2018-05-25  9:10 ` 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=20180518090923.GA31336@infradead.org \
    --to=hch@infradead.org \
    /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).