Re: sg driver and Fedora Core 2

James Bottomley
2004-05-29T17:38:48Z

On Sat, 2004-05-29 at 12:27, Jeff Garzik wrote:
> Really what needs to happen is a generic userland tap attaches to a
> chrdev, issues an ioctl(2) to attach to a request_queue, and then does
> read(2)/write(2)/mmap(2) to communicate with the request_queue.
>
> :)
>
> Call it /dev/bsg, or somesuch.

Well, this touches on something else I'm thinking about: lazy
attachment. In multi thousand disc environments, you don't want us
wasting resources allocating a queue and reading a partition table for
all of them; you really only want to do that for the devices you're
actually going to use. Once we have this, I think dual attachment will
be a dead issue.

> The SG_IO ioctl won't work for all cases, since some block devices may
> rightly wish to limit (or block) multiple openers on the blkdev itself.
> OTOH, the SG_IO ioctl does eliminate the userland app needing to
> worry about _any_ target/addressing information, since that is implicit
> in the dentry pointing to the blkdev's inode.

Yes, the mapping issues is the huge problem where users keep shooting
themselves in the foot.

James