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

Ming Zhang blackmagic02881
Tue Jan 23 17:24:16 CET 2007


On Tue, 2007-01-23 at 11:19 -0500, Pete Wyckoff wrote:
> 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.

exactly. because even it is a SPC command, it is handled differently
from type to type.

> 
> 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).

good reason is simpler interface, each particular target type only
fulfill a few interface in order to accomplish the work. and less extern
functions define in .h.

> 
> 		-- Pete
-- 
http://blackmagic02881.wordpress.com/




More information about the stgt mailing list