public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Andras Kovacs <akovacs@fixstars.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: UNMAP command parameter list
Date: Mon, 10 Nov 2014 11:44:39 -0500	[thread overview]
Message-ID: <yq17fz36m4o.fsf@sermon.lab.mkp.net> (raw)
In-Reply-To: <loom.20141110T164410-58@post.gmane.org> (Andras Kovacs's message of "Mon, 10 Nov 2014 15:56:11 +0000 (UTC)")

>>>>> "Andras" == Andras Kovacs <akovacs@fixstars.com> writes:

>> Thank you. Then I guess I'll find the Paramerer List in the struct
>> scsi_data_buffer sdb variable (within struct scsi_cmnd). Will check
>> on Monday.

Andras> I've looked into it, but struct scsi_data_buffer doesn't contain
Andras> a byte array (rather a struct sg_table variable and some
Andras> housekeeping vars). So my question is still: where can I find
Andras> the Parameter List associated with a particular UNMAP command?

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.

-- 
Martin K. Petersen	Oracle Linux Engineering

  reply	other threads:[~2014-11-10 16:44 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 [this message]
2014-11-10 17:40         ` Christoph Hellwig
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=yq17fz36m4o.fsf@sermon.lab.mkp.net \
    --to=martin.petersen@oracle.com \
    --cc=akovacs@fixstars.com \
    --cc=linux-scsi@vger.kernel.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