Re: BSD XFS Port BSD VFS Rewrite

1999-08-17 Thread Michael Hancock

  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.

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. 

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.

Regards,


Mike Hancock




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: BSD XFS Port BSD VFS Rewrite

1999-08-17 Thread Michael Hancock

On Tue, 17 Aug 1999, Bill Studenmund wrote:

 I've compared the two, and making the NetBSD number match the FreeBSD
 number is one of my goals. :-)
 
 Any suggestions, or just plodfix?

It can be very cumbersome tracking down references being bumped by
vref/VREF and other operations.

Among the uncompleted operations are VOPs that pre-release the returned
vpp to the caller.  I think in VOP_MKNOD this was done as a convenience
and you might have to add code to handle device vp aliases correctly.

Just remember the rule, the allocating layer must be the layer that
deallocates.

Regards,


Mike



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: BSD XFS Port BSD VFS Rewrite

1999-08-17 Thread Michael Hancock
  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.

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. 

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.

Regards,


Mike Hancock




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



Re: BSD XFS Port BSD VFS Rewrite

1999-08-17 Thread Michael Hancock
On Tue, 17 Aug 1999, Bill Studenmund wrote:

 I've compared the two, and making the NetBSD number match the FreeBSD
 number is one of my goals. :-)
 
 Any suggestions, or just plodfix?

It can be very cumbersome tracking down references being bumped by
vref/VREF and other operations.

Among the uncompleted operations are VOPs that pre-release the returned
vpp to the caller.  I think in VOP_MKNOD this was done as a convenience
and you might have to add code to handle device vp aliases correctly.

Just remember the rule, the allocating layer must be the layer that
deallocates.

Regards,


Mike



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



Re: BSD XFS Port BSD VFS Rewrite

1999-08-17 Thread Michael Hancock
  Have you tried Heidemann's student's stacking layers?  There is one
  encryption, and one per-file compression with namespace hiding, that
  I think it would be hard pressed to keep up with.  But I'll give it
  the benefit of the doubt.  8-).
 
 Nope. The problem is that while stacking (null, umap, and overlay fs's)
 work, we don't have the coherency issues worked out so that upper layers
 can cache data. i.e. so that the lower fs knows it has to ask the uper
 layers to give pages back. :-) But multiple ls -lR's work fine. :-)

Interesting, have you read the Heidemann paper that outlines a solution
that uses a cache manager?

You can probably find it somewhere here,
http://www.isi.edu/~johnh/SOFTWARE/UCLA_STACKING/





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



Re: BSD XFS Port BSD VFS Rewrite

1999-08-17 Thread Michael Hancock
I forgot I had some old diffs that may be of help,
http://www.freebsd.org/~mch/vop1a.diff

You'll notice that just about everywhere that I moved vput() to the
appropriate layer a path component buffer was also freed in the wrong
place.  John Dyson put these buffers in zones so the free routine probably
looks very different than in netbsd.

zfree(namei_zone, cnp-cn_pnbuf);
-   vput(dvp);

Regards,


Mike



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