[ENBD] proxing ioctl's
Peter T. Breuer
ptb@it.uc3m.es
Mon, 12 Mar 2001 21:34:42 +0100 (MET)
"A month of sundays ago Daniel Shane wrote:"
> Sure, I would like nbd to be able to emulate any block device.
You want to handle the ioctls as well as the read/write calls.
> Lets say, for example, that I would like to emulate the floppy
> driver. Well... the floppy driver uses special ioctls, and some
> of them might pass pointers to structures (not just an int or a char)
> as arguments to the ioctl call.
maybe, maybe not. I don't know. The problem is that the context for
those is on the client, not on the server.
> The problem is, if its the client that is calling the ioctl and the
> server that is executing it, we need to be able to transfer that
> structure to the other end. Serializing the structure is impossible
> since we need somekind of reflexion to parse it and I
> dont know if we can do something on the server end to redirect the
> memory access to the client in a general way...
>
> I was guessing that we could play with memory relocation. Not sure
> though.
>
OK. I'll reply later.
> BTW: About client journaling, I just took a look at the ram disk
> driver and they use a clever trick which I think we could use. They
> use the buffer cache as the ramdisk by preventing the kernel from
> ever freeing the pages that we write to. Therefore, we dont need
> to handle writes at all, the buffer cache manages it for us. What
> do you think about integrating this approach in nbd?
Could do. I'll look.
Peter