[Stgt-devel] supporting non-block devices

FUJITA Tomonori fujita.tomonori
Sat Jan 20 15:04:45 CET 2007


From: Pete Wyckoff <pw at osc.edu>
Subject: [Stgt-devel] supporting non-block devices
Date: Fri, 19 Jan 2007 12:01:42 -0500

> We've been using the fine stgt code as the target for our OSD-2
> emulator.  OSDs are devices that store objects rather than blocks,
> and they have a quite different SCSI command set, and do not support
> all the block commands in SBC3, e.g.:  there is no READ_10 command
> or its friends.  See http://www.t10.org/drafts.htm#osd2 for the
> draft.
> 
> Do you have any interest in supporting non-block devices in stgt?

Yeah. I plan to add OSD support at least (see enum
tgtadm_target_type).


> The way we hack in OSD support now is unattractive.  To do it nicely
> would require changing the abstractions a bit.
> 
> In particular, we want the iscsi transport, but do not want the
> aio_bdt.  So I define a new tgt_driver that uses most of the iscsi
> functions, but points to a new osd_bdt, and redefines scsi_inquiry.
> (This is all userspace, no kernel tgt code.)
> 
> In scsi_cmd_perform, most of the scb[] types are supported by OSDs
> so we would like to use that code.  But not READ* and WRITE*.  And
> all the new OSD commands come via a VARLEN_CMD (0x7f) for which I've
> added a new varlen_submit() function in the osd_bdt that does the
> command parsing and actual execution.  Kludgy since this should not
> be part of the bdt.

I plan to split the current scsi command code; spc.c and sbc.c. The
device type specific code (sbc.c, osd.c, etc) can use functions in
spc.c.



More information about the stgt mailing list