Re: [PATCH] [Target_Core_Mod/PSCSI]: Use struct request to structscsi_device->request_queue

From: Nicholas A. Bellinger
Date: Wed Dec 03 2008 - 16:41:32 EST

On Wed, 2008-12-03 at 12:42 +0200, Boaz Harrosh wrote:
> Nicholas A. Bellinger wrote:
> >>From 1b14b5e1fc9a7074322b1015bb86eca2a8ef4560 Mon Sep 17 00:00:00 2001
> > From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
> > Date: Tue, 2 Dec 2008 16:30:51 -0800
> > Subject: [PATCH] [Target_Core_Mod/PSCSI]: Use struct request to struct scsi_device->request_queue
> >
> > This patch begins to remove the usage of scsi_execute_async() from the PSCSI
> > subsystem plugin for v3.0 generic target core.
> >
> > It uses blk_get_request() to allocate struct request in pscsi_blk_get_request()
> > and used by all CDB types and both memory backing types. struct request is then
> > released with __blk_put_request() in the struct request->end_io() context in
> > pscsi_req_done().
> >
> > Also, this patch adds a temporary EXPORT_SYMBOL_GPL() for
> > scsi/drivers/scsi_lib.c:scsi_req_map_sg() (which will also be going away at
> > some point). At that point, the upstream struct scatterlist and/or
> > struct page -> struct request mapping for usage with struct scsi_device->request_queue
> > will be dropped into place in drivers/lio-core/target_core_pscsi.c:pscsi_map_task_SG()
> >
> > Tested on v2.6.28-rc7 32-bit x86 with virtual VMware TYPE_DISK on virtual MPT-Fusion
> >
> > Signed-off-by: Nicholas A. Bellinger <nab@xxxxxxxxxxxxxxx>
> > ---
> > drivers/lio-core/target_core_pscsi.c | 206 +++++++++++++++++++++++++---------
> > drivers/lio-core/target_core_pscsi.h | 5 +-
> > drivers/scsi/scsi_lib.c | 6 +-
> > 3 files changed, 161 insertions(+), 56 deletions(-)
> >
> This patch confuses me. Is this the same one posted few days ago minus the double-free
> bug? It would be nice if you said that somewhere. Like [PATCH ver2] ...

<nod> sorry for the confusion.

> But what confuses me are the previous two patches you sent that makes this patch not
> compile. (Rename of se_task_t->task_buf => se_task_t->task_sg).

Ok yes, this one is the 2nd rev of the original patch to remove the
usage of scsi_execute_async(). The other two are for getting rid of the
casts in between target_core_mod se_task_t scatterlist memory and
mapping into target core subsystem plugins (PSCSI, IBLOCK, FILEIO)
following your recommendations.

> The previous two patches are not bisectable btw. Numbering a patchset could maybe help
> a little, but will not help here, whichever way you order them they will only compile at
> the very end (Well not even that, not with this one applied).

<nod, point taken.

> Sorry but I'm unable to farther review any of the patches. Please re-post everything
> as a patchset so I can understand whats going on.

Ok, here commit diffs for the three patches that affect target_core_mod:

[PATCH] [Target_Core_Mod/PSCSI]: Use struct request to struct scsi_device->request_queue;a=commitdiff;h=1b14b5e1fc9a7074322b1015bb86eca2a8ef4560

[PATCH] [Target_Core_Mod]: Convert to se_task_t->task_sg usage in core and subsystem plugins;a=commitdiff;h=41e98940da5ffaf7e31fce8d1f706e3e0a679654

[PATCH] [Target_Core_Mod]: Update PSCSI, IBLOCK, FILEIO and RAMDISK for se_task_t->task_sg;a=commitdiff;h=e030ca2b9bbb81402b3ed669bb5e1d54fed0dff7

> (And please give the URL of the git tree they are based on in each [PATCH 00/xx] mail.
> Usually one states what the patchset is based on, eg. "based on scsi-misc as of ..."
> but we all know where scsi-misc is)

Ok, these patches are against the development lio-core-2.6.git (v3.0)
tree (currently at v2.6.28-rc7) which tracks linux-2.6.git. I will be
sure to include this in futher postings.

Also, I am posting the patches related to the generic target core
(target_core_mod) and plugins that hook into Linux storage subsystems
(PSCSI, IBLOCK, FILEIO) to start getting some feedback on the current
work in the v3.0 development tree. The code in
lio-core-2.6.git/drivers/lio-core is the ConfigFS enabled generic target
engine, subsystem plugins, and traditional LIO iSCSI target engine that
will be submitted for upstream inclusion (most likely in that order) as
work continues, sometime in the v2.6.29 timeframe.

Many thanks for your comments,


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at