On Wed, 03 Feb 2010 18:06:55 +0100 juergen.kadidlo@xxxxxxxxxx wrote: > I'm trying to write a driver for a new type of iSCSI target and I'm > using "bs_rdwr.c" as a reference. However, there are some things that > are pretty unclear to me, and one of them is: how are parameters like > sector-size and number of sectors of a device determined? I could not > find code that queries these parameters from the target-device. And > tgtadm doesn't seem to support such params. However, there is not much > documentation, so I'm not sure about that... > > To be more precise: assuming that I want to use a file as a target, how > can I specify the sector-size and number of sectors/bytes? I'm not sure what exactly you want to try. What is 'your anew type of iSCSI target'? Probably 'bs_rdwr.c' is a wrong reference for you. It just does I/Os via system calls. There is not much SCSI stuff there. The device size (the number of sectors) is stored in struct scsi_lu. The sector size depends on what device type you want to use. If you are trying something with disk (sbc), then the following patch might be useful for you: http://lists.wpkg.org/pipermail/stgt/2009-December/003469.html -- To unsubscribe from this list: send the line "unsubscribe stgt" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html