tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/40375: netbsd-5: Process locks in vnode wchan when writing to LFS



On Fri Jan 16 2009 at 08:55:40 -0500, matthew sporleder wrote:
> How difficult is it to FUSE-ify an existing filesystem?  I looked at
> some FUSE docs for this purpose, but wasn't really sure how to get
> started on a filesystem as complicated as LFS or even UFS/FFS.

There are two parts to your question:
1) how to map the file system interface (vfs/vnode) to FUSE
2) how to map the backend kernel interfaces the file system uses to
   userspace.

The first subproblem is fairly easy and the second one is fairly
labour intensive.  Commonly (e.g. ext2fs-fuse, which uses ext2fs-tools),
"FUSE-ification" done by a complete rewrite for userspace from scratch.
Naturally this avoids the second problem, but it also adds a second
implementation with the need to follow file system evolution, maintain
it, fix separate bugs, etcetc.

For NetBSD file systems, using the kernel file system code directly is
possible, and you literally do not need to write any code.  "1" is done
by libp2k and "2" is done by rump, both in a general fashion valid for
all(*) NetBSD file systems.

For more information, see the following links, especially the second one:
http://www.netbsd.org/docs/rump/
http://www.netbsd.org/docs/puffs/rump.html

The implementation is linked with puffs, so strictly speaking it's
not FUSE.  If you absolutely must have FUSE for some reason, you would
need to write a component equivalent to p2k.  This is mostly an issue
of taking libp2k and changing the interface names.  I would expect it
to take no longer than a few hours with some prior FUSE experience.

*) Ok, almost all.  Out of our data file systems, support is missing for:
  + smbfs - implementation split between kernel and userspace
  + filecorefs - couldn't find a test image
  + adosfs - file system needs information from the disklabel,
             so I didn't consider supporting it very meaningful,
             as it does not work with images.
See p2k(3) for a full list.

As a special case, LFS megamaid a.k.a. cleanerd does not work.  It would
be possible to support, but given the state of LFS, I haven't bothered.


Home | Main Index | Thread Index | Old Index