From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: target-devel <target-devel@vger.kernel.org>
Cc: linux-scsi <linux-scsi@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Christoph Hellwig <hch@lst.de>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Subject: Re: [PATCH-v2 3/3] target/iblock: Add WRITE_SAME w/ UNMAP=0 emulation support
Date: Thu, 15 Nov 2012 12:39:17 -0800 [thread overview]
Message-ID: <1353011957.11597.5.camel@haakon2.linux-iscsi.org> (raw)
In-Reply-To: <1353010439-4600-4-git-send-email-nab@linux-iscsi.org>
On Thu, 2012-11-15 at 20:13 +0000, Nicholas A. Bellinger wrote:
> From: Nicholas Bellinger <nab@linux-iscsi.org>
>
> This patch adds support for emulation of WRITE_SAME w/ UNMAP=0 within
> iblock_execute_write_same() backend code.
>
> The emulation uses a bio_add_page() call for each sector, and by default
> enforces a limit of max_write_same_len=0xFFFF (65536) sectors following
> what scsi_debug reports per default for MAXIMUM WRITE SAME LENGTH.
>
> It also sets max_write_same_len to the operational default at setup ->
> iblock_configure_device() time.
>
> (hch: Move unmap logic into iblock_execute_write_same_unmap + add
> check for single sector SGLs in iblock_execute_write_same)
> (mkp: Update comment for 0xFFFF magic constant)
>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Martin K. Petersen <martin.petersen@oracle.com>
> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
> ---
> drivers/target/target_core_iblock.c | 91 ++++++++++++++++++++++++++++++++---
> 1 files changed, 84 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
> index 53f4501..5abbd55 100644
> --- a/drivers/target/target_core_iblock.c
> +++ b/drivers/target/target_core_iblock.c
> +static sense_reason_t
> +iblock_execute_write_same(struct se_cmd *cmd)
> +{
> + struct iblock_req *ibr;
> + struct scatterlist *sg;
> + struct bio *bio;
> + struct bio_list list;
> + sector_t block_lba = cmd->t_task_lba;
> + unsigned int sectors = spc_get_write_same_sectors(cmd);
> +
> + if (sectors > cmd->se_dev->dev_attrib.max_write_same_len) {
> + pr_warn("WRITE_SAME sectors: %u exceeds max_write_same_len: %u\n",
> + sectors, cmd->se_dev->dev_attrib.max_write_same_len);
> + return TCM_INVALID_CDB_FIELD;
> + }
<SNIP>
Forgot to remove this now redundant check for max_write_same_len.
Dropping now..
prev parent reply other threads:[~2012-11-15 21:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-15 20:13 [PATCH-v2 0/3] target/iblock: Add WRITE_SAME w/ UNMAP=0 emulation Nicholas A. Bellinger
2012-11-15 20:13 ` [PATCH-v2 1/3] target/sbc: Seperate WRITE_SAME based on UNMAP flag in sbc_ops Nicholas A. Bellinger
2012-11-15 20:13 ` [PATCH-v2 2/3] target: Add/check max_write_same_len device attribute + update block limits VPD Nicholas A. Bellinger
2012-11-15 20:38 ` Nicholas A. Bellinger
2012-11-15 20:13 ` [PATCH-v2 3/3] target/iblock: Add WRITE_SAME w/ UNMAP=0 emulation support Nicholas A. Bellinger
2012-11-15 20:39 ` Nicholas A. Bellinger [this message]
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=1353011957.11597.5.camel@haakon2.linux-iscsi.org \
--to=nab@linux-iscsi.org \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=target-devel@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
all inboxes | Powered by JetHome®