inode grafting

utzoo!decvax!pur-ee!purdue!rlb utzoo!decvax!pur-ee!purdue!rlb
Thu May 6 23:46:02 AEST 1982



We have added a facility to our 4.1BSD UNIX that allows us to
link files and directories across file system boundaries in a
manner effectively similar to 4.2's symbolic links.  The facility,
called grafting, allows our users to imagine that their home
directories are all in /usr when in fact thye're elsewhere...even
on a separate disk.  We're relatively sure that the implementa-
tion is more effecient than symbolic links - it's basically an
extension of the file system mount  capability.

We have programs, /etc/graft and /etc/ungraft that mimic the
operation of mount and umount - there's even a file named
/etc/dirtab like /etc/fstab and one named /etc/gtab like
/etc/mtab.  We execute "graft -a" in /etc/rc to mount users'
directories onto empty directories in /usr.  This does cause the
directory tree to become a non-tree graph but since it's direct-
ed, with care it can remain acyclic.  Of course, the use of graft
is restricted to root.

The implementation is basically a duplication of the mount code
in the kernel...a hash-accessed table is kept in core in a format
almost identical to the mount table, though there's an added
inode field.  Since we keep the inodes of the grafted-on direc-
tories in core (just as mounted-on directories have their inodes
in core), the facility isn't applicable to huge user communities.
We run with NGRAFT at 250 and NINODE increased by that amount.
I'll bet these inodes could be moved out of the incore inode
table if need be such.  There are changes to nami() (to handle ..)
and iget() and other little changes here and there.

It's been in operation over a month on one of our department
VAXes and we're about to install it another.  Also, I changed the
tree traversal routine in find(1) to a graph traversal routine to
speed up those early morning "find / ..." commands out of crontab.

Chris Kent wrote the user-level code and I did the kernel work.
If you're interested on the details/code/implementation notes or
manual pages on grafts, drop me a note.

Bob Brown
Purdue CS



More information about the Comp.unix.wizards mailing list