Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Aug 1999 17:16:46 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        michaelh@cet.co.jp (Michael Hancock)
Cc:        tlambert@primenet.com, wrstuden@nas.nasa.gov, Matthew.Alton@anheuser-busch.com, Hackers@FreeBSD.ORG, fs@FreeBSD.ORG
Subject:   Re: BSD XFS Port & BSD VFS Rewrite
Message-ID:  <199908181716.KAA12220@usr02.primenet.com>
In-Reply-To: <Pine.BSF.3.95LJ1.1b3.990817224323.17508B-100000@sv01.cet.co.jp> from "Michael Hancock" at Aug 17, 99 11:18:06 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> > > I'm not familiar with the VFS_default stuff. All the vop_default_desc
> > > routines in NetBSD point to error routines.
> > 
> > In FreeBSD, they now point to default routines that are *not* error
> > routines.  This is the problem.  I admit the change was very well
> > intentioned, since it made the code a hell of a lot more readable,
> > but choosing between readable and additional function, I take function
> > over form (I think the way I would have "fixed" the readability is by
> > making the operations that result in the descriptor set for a mounted
> > FS instance be both discrete, and named for their specific function).
> 
> As I recall most of FBSD's default routines are also error routines, if
> the exceptions were a problem it would would be trivial to fix.

You would have to de-collapse several VOP lists that have been
pre-collapsed.  The pre-collapse is also an issue for stacking,
since the collapse is supposed to be late bound to the stacking
operation itself.  This lets you revisit it later when you need
to add a new VOP into the system, so that there's a NULL pointer
in the VOP slot for older FS's, in case you stack on top of them.
This is particularly true of an FS stacked on an FS stacked on a
proxy layer.


> I think fixing resource allocation/deallocation for things like vnodes,
> cnbufs, and locks are a higher priority for now.  There are examples such
> as in detached threading where it might make sense for the detached child
> to be responsible for releasing resources allocated to it by the parent,
> but in stacking this model is very messy and unnatural.  This is why the
> purpose of VOP_ABORTOP appears to be to release cnbufs but this is really
> just an ugly side effect.  With stacking the code that allocates should be
> the code that deallocates. Substitute, "code"  with "layer" to be more
> correct. 

Yes.  That's actually maintenance, not rewrite, and I think it's
very important to address.  I'm rather pleased with the way the
NFS stuff has turned out (so far), and I was the one calling for
a return to first principles (i.e. a rewrite from the specification).


> I fixed a lot of the vnode and locking cases, unfortunately the ones that
> remain are probably ugly cases where you have to reacquire locks that had
> to be unlocked somewhere in the executing layer.  See VOP_RENAME for an
> example.  Compare the number of WILLRELEs in vnode_if.src in FreeBSD and
> NetBSD, ideally there'd be none.

The way I handled this in the rename case on my hacking box was by
adding a flag to the namei() call.  You could call this flag the
same as WILLRELE, but it had inverse semantics.

Really, this is another issue of reflexivity being absent from an
interface.  You really don't want asymmetric interfaces (VOP_LOCK
is an example, in many cases, based on internal use in the FFS).


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199908181716.KAA12220>