public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: linux-scsi <linux-scsi@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Christoph Hellwig <hch@lst.de>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	Mike Christie <michaelc@cs.wisc.edu>,
	Hannes Reinecke <hare@suse.de>,
	James Bottomley <James.Bottomley@suse.de>,
	Boaz Harrosh <bharrosh@panasas.com>,
	Nicholas Bellinger <nab@linux-iscsi.org>
Subject: [PATCH 0/4] tcm: Unify virtual subsystem plugin emulation code
Date: Sat,  9 Oct 2010 20:48:18 -0700	[thread overview]
Message-ID: <1286682498-4821-1-git-send-email-nab@linux-iscsi.org> (raw)

From: Nicholas Bellinger <nab@linux-iscsi.org>

Greetings all,

This series contains patches to unify TCM virtual subsystem plugin emulation
logic into generic TCM code, and to provide a method of emulation for control
CDBs that are emulated generically across subsystem plugin code or that may
require CDB specific context in the new struct se_subsystem_api_cdb set of
subsystem dependent CDB callers.

The first patch adds a generic function transport_emulate_control_cdb()
which is intended used by virtual subsystem plugin code.  This includes
the primary list of CDBs handled in this manner from existing IBLOCK,
FILEIO and RAMDISK *_emulate_scsi_cdb() subsystem dependent code, and the
struct se_subsystem_api_cdb define described above.

Thse second patch converts IBLOCK, FILEIO and RAMDISK subsystem code to use
the new ->emulate_inquiry(), ->emulate_read_cap(), ->emulate_read_cap16() and
->emulate_unmap() callers their respective existing subsystem dependent logic.

The third and forth patches move WRITE_SAME_* and SYNCHRONIZE_CACHE_* CDB
emulation logic into transport_emulate_control_cdb() for these two originally
specially handled cases with IBLOCK and FILEIO subsystem code.

So far this code has been tested on TCM_Loop SCSI LUN with IBLOCK, FILEIO and
IBLOCK backstores with TPU=1, TPWS=1 and WCE=1 on v2.6.36-rc6.

Many thanks go out to Christoph for a bit of friendly prodding to finally make
this conversion happen.  Thanks hch!

Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>

Nicholas Bellinger (4):
  tcm: Unify subsystem plugin control CDB emulation
  tcm: Convert IBLOCK, FILEIO and RAMDISK subsystem code to
    transport_emulate_control_cdb()
  tcm: Move WRITE_SAME_* emulation into transport_emulate_control_cdb()
  tcm: Move SYNCHRONIZE_CACHE_* emulation into
    transport_emulate_control_cdb()

 drivers/target/target_core_file.c      |  163 ++++++++------------------
 drivers/target/target_core_iblock.c    |  102 +++-------------
 drivers/target/target_core_rd.c        |   91 ++-------------
 drivers/target/target_core_transport.c |  200 ++++++++++++++++++++++----------
 include/target/target_core_base.h      |    4 +-
 include/target/target_core_transport.h |   26 +++-
 6 files changed, 237 insertions(+), 349 deletions(-)

             reply	other threads:[~2010-10-10  3:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-10  3:48 Nicholas A. Bellinger [this message]
2010-10-10  7:32 ` [PATCH 0/4] tcm: Unify virtual subsystem plugin emulation code Christoph Hellwig
2010-10-11 19:56   ` Nicholas A. Bellinger
2010-10-12 19:00   ` Vladislav Bolkhovitin

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=1286682498-4821-1-git-send-email-nab@linux-iscsi.org \
    --to=nab@linux-iscsi.org \
    --cc=James.Bottomley@suse.de \
    --cc=bharrosh@panasas.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michaelc@cs.wisc.edu \
    /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