Re: userspace block driver?

From: Guennadi Liakhovetski
Date: Wed Nov 09 2005 - 15:58:37 EST


On Wed, 9 Nov 2005, Jeff Garzik wrote:

>
> Has anybody put any thought towards how a userspace block driver would work?
>
> Consider a block device implemented via an SSL network connection. I don't
> want to put SSL in the kernel, which means the only other alternative is to
> pass data to/from a userspace daemon.
>
> Anybody have any favorite methods? [similar to] mmap'd packet socket? ramfs?

Heh, thanks, Jeff, for bringing this subject up again, hasn't been that
long ago

http://marc.theaimsgroup.com/?l=linux-kernel&m=113140332009208&w=2

, which was indeed asked with nbd in mind. To remind you and others in

http://marc.theaimsgroup.com/?t=111524157800004&r=1&w=2
http://marc.theaimsgroup.com/?t=111706463800001&r=1&w=2

I played a bit with extending nbd to map block devices to the client
system more transparently, which means, as James Bottomley explained,
basically supporting REQ_BLOCK_PC requests. He also suggested not to use
ioctls on both sides, which is where I stopped. I can understand how to
avoid implementing ioctl in the nbd driver and intercepting REQ_BLOCK_PC
requests instead, but on the server side? Assume you get the request
object on the client, send it to the server, and then? Even if there
existed a generic interface to block devices, allowing to inject requests
directly from user space into block queue, wouldn't the same problems with
endianness, 32/64 bit stay? The advantage, perhaps, would be that the
request structure is standard, so, the conversion would be universal?

So, my problem is - how to send a generic request to a device (disk /
cdrom / loop / sg / st / ...) from the user space? Hence my recent
question...

Thanks
Guennadi
---
Guennadi Liakhovetski
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/