Directly handle ioctls issued to a SCSI device associated with a softraid
volume, ignoring any device name specified in the bio(4) ioctl struct.
One of bio(4)'s design flaws is that the device name is hardcoded in many
of the ioctl structs, making it basically unusable with DUIDs. In the case
of `bioctl -d' the bioctl(8) code actually uses opendev(3) on the given
name, then issues the ioctl directly to the resulting device. As such, we
already know which device (or in this case, softraid volume) the ioctl was
intended for, however the current softraid(4) code ignores this and instead
attempts to perform a lookup using the name in the bio(4) ioctl struct.
This diff splits the sr_bio_ioctl() code into two parts - one that implements
the API required by bio(4) and the other that contains the ioctl handling
code, which now takes an optional pointer to the softraid discipline. If an
ioctl is issued to a SCSI device associated with a softraid volume, pass
the corresponding softraid discipline struct through and to the bio ioctl
handler and use it in preference to performing a device name lookup.
Amongst other things, this makes bioctl -d now work with DUIDs.
ok krw@