[Stgt-devel] [PATCH 4/4] OSD command parser

FUJITA Tomonori fujita.tomonori
Mon Feb 19 15:32:59 CET 2007


From: Pete Wyckoff <pw at osc.edu>
Subject: Re: [Stgt-devel] [PATCH 4/4] OSD command parser
Date: Tue, 23 Jan 2007 11:19:17 -0500

> blackmagic02881 at gmail.com wrote on Mon, 22 Jan 2007 14:35 -0500:
> > not a good idea. suggest to keep in a way like IET code, for each target
> > type, call its foo_cmd_perform(), and make some common spc function as
> > helper functions.
> 
> I think you're saying that I should duplicate the switch() logic for
> the SPC commands in all the (osd|sbc|mmc|...)_cmd_perfom()
> type-specific functions.  This would reduce scsi_cmd_perform() into
> just a check on the target type, with no handling of SPC commands,
> e.g. INQUIRY.
> 
> I'm not opposed to doing that, just don't have a good reason to do
> so.  As the OSD work progresses this may become clear to me (PERFORM
> SCSI COMMAND and PERFORM TASK MANAGEMENT FUNCTION).

Very sorry for taking so long.

I put a patch to support various device types:

http://zaal.org/tgt/device-types.diff


I don't merge it because:

- only iscsi + AIO works (sg and ibmvio are broken).

- there are still lots of things to implement

- huge cleanup is necessary


I took an approach discussed a long time ago in IET mailing list. Each
device type has its own function array (like sbc_mode_sense). spc code
exports some common functions. A LLD can cleanly replace functions in
arrays (so we can kill dirty hack in tgt_driver struct). A transport
class also needs that (though we don't implement yet).



More information about the stgt mailing list