Hi,
After all that SG_IO and cdrecord talk, I decided to brush off the bsg
driver I wrote some time ago. Basically this is a full (aims to be at
least, probably still some minor bits missing) SG v3 interface. It
supports both SG_IO (which we just pass through for now), as well as
read/write and readv/writev of sg_io_hdr structures.
What's new in this area is that the bsg character device is closely tied
to the block device. This relationsship is depicted in sysfs. bsg
devices will show up in /sys/class/bsg/<devname>, and there is a link
from /sys/block/<devname>/queue/bsg to that directory. With some
udev/hotplug magic, it should create device nodes for you automatically.
TODO:
- Fold block/scsi_ioctl.c and block/bsg.c into one
- Further improve the sysfs relations between a device and bsg
- Test and so on
Probably some bugs still pending, it works for me though.