Subject: Re: puvnd (pass to userland vnd)?
To: None <tech-kern@NetBSD.org>
From: Antti Kantee <pooka@cs.hut.fi>
List: tech-kern
Date: 03/09/2007 05:40:32
On Fri Mar 09 2007 at 12:16:36 +1100, Daniel Carosone wrote:
> On Fri, Mar 09, 2007 at 12:25:01AM +0100, Dieter Baron wrote:
> >   Or is it preferable to have the ability to pass block read/write
> > requests to a vnd to a user land process, similar to what puffs does
> > for file systems?
> 
> It might be (for efficiency or other similar reasons) but it shouldn't
> strictly be necessary -- nor am I sure that it's the most
> generally-useful model.
> 
> You should be able to use vnd with a file vnode backed by a puffs
> filesystem (for example, encfs or lzofs).  vnd will turn the block ops
> into vnops just as it does now, and puffs will forward the vnops.
> 
> There's a problem with this right now - it doesn't work because puffs
> has a KASSERT about not getting B_READ|B_ASYNC requests, which vnd
> issues (unconditionally) via the nestiobuf_* stuff in kern/vfs_bio.c.

As a stopgap, you can just remove the KASSERT and vnd will work (at
least it used to before I added that assert).  The requests will just
be issued syncronously.

> I was chatting to pooka about this yesterday in the midst of other
> things, and hopefully it'll be resolved soon, and we'll be able to
> make use of all the other new kinds of vnodes puffs+fuse can give us
> with vnd.

Yea, I'll fix it properly once I get home next week, not really a biggie.

> That being said, for specialised block-device-like formats, maybe a
> pass-to-userspace block driver (not via vnd) would be useful too,
> rather than going via vfs and back.  (ie, the operations passed would
> be ops like strategy, start, .., from the block layer).
> 
> Perhaps "pud" (pass-to-user device) or "pub" (... block) or "pus"
> (... strategy) ..

There's also been talk about generalizing the whole user-kernel transport
stuff a bit.  The case was char devices, but it might as well expand to
much more.

-- 
Antti Kantee <pooka@iki.fi>                     Of course he runs NetBSD
http://www.iki.fi/pooka/                          http://www.NetBSD.org/
    "la qualité la plus indispensable du cuisinier est l'exactitude"