how to write code for a new virtual file system type

Dave Hitz auspex!hitz at uunet.uu.net
Sat Dec 2 06:45:42 AEST 1989


In article <3281 at brazos.Rice.edu> esquire!yost at cmcl2.nyu.edu writes:
>X-Sun-Spots-Digest: Volume 8, Issue 206, message 15 of 15
>
>I am investigating implementing Watchdogs [Bershad 88] via a new virtual
>file system type under Sun OS.  Unfortunately, when I looked through the
>Sun documentation for information on implementing a new virtual file
>system type, I found only one paragraph.
>
>Has anyone ever done this?  Where's the documentation?
>
>I'd love to see code for a sample VFS that hooks up to all the entry
>points and simply passes the calls through to another VFS node.

We've done our own filesystem using Sun's virtual file system type at
Auspex, and I also ported the BSD filesystem to SysV under its virtual
file system equivalent (the file system switch).

These file system interfaces are not nearly as stable or well documented
as the character and block device interfaces.  I would not want to
implement a new filesystem without source.

Can you get an NFS source release from sun?

Another alternative is to develop a user process that functions as an NFS
server.  In mount(2) the argument is actually a socket; the kernel doesn't
care whether the socket leads to an NFS server in the kernel of a remote
system, or to an NFS server implemented as a user process on your own
system.  The main advantage of this is that the NFS interface is well
documented.

Once you've got your user process handling file system requests, you can
do whatever you want.  This may be more expensive than working in the
kernel, but watchdogs are also in user space.  You may want to eliminate
the watchdog concept and just put whatever features you want directly to
this NFS user process.

Dave Hitz					home: 408-739-7116
UUCP: {uunet,mips,sun,bridge2}!auspex!hitz 	work: 408-492-0900



More information about the Comp.sys.sun mailing list