public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Andras Kovacs <akovacs@fixstars.com>, linux-scsi@vger.kernel.org
Subject: Re: UNMAP command parameter list
Date: Mon, 10 Nov 2014 09:40:43 -0800	[thread overview]
Message-ID: <20141110174043.GA26944@infradead.org> (raw)
In-Reply-To: <yq17fz36m4o.fsf@sermon.lab.mkp.net>

On Mon, Nov 10, 2014 at 11:44:39AM -0500, Martin K. Petersen wrote:
> You'll have to traverse scatterlist and extract the descriptor from
> there. You can use scsi_for_each_sg() to walk the list.
> 
> If you only care about in-kernel discards it's pretty easy since we only
> issue a single descriptor. If you want to support arbitrary block pc
> UNMAP commands you'll have to be able to deal with multiple descriptors
> across multiple scatterlist elements. But the accessor macro makes that
> easy so I suggest you take that approach.

Note that if the hardware doesn't actually implement UNMAP and you have
to emulate something you're probably better off emulating WRITE SAME
(16) with the UNMAP bit, as the format is a lot easier to handle,
and it's much better specified to start with.

  reply	other threads:[~2014-11-10 17:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-07 23:30 UNMAP command parameter list Andras Kovacs
2014-11-07 23:57 ` Elliott, Robert (Server Storage)
2014-11-08 20:22   ` Andras Kovacs
2014-11-10 15:56     ` Andras Kovacs
2014-11-10 16:44       ` Martin K. Petersen
2014-11-10 17:40         ` Christoph Hellwig [this message]
2014-11-10 17:52           ` Martin K. Petersen
2014-11-10 18:10           ` Andras Kovacs

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=20141110174043.GA26944@infradead.org \
    --to=hch@infradead.org \
    --cc=akovacs@fixstars.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /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