cvs commit: src/sys/kern vfs_subr.c

Brian Fundakowski Feldman green at FreeBSD.org
Thu Jun 16 14:50:06 GMT 2005


On Thu, Jun 16, 2005 at 12:46:59AM -0400, Jeff Roberson wrote:
> On Thu, 16 Jun 2005, Jeff Roberson wrote:
> 
> > jeff        2005-06-16 04:41:42 UTC
> 
> This fixes duplicate frees from the vnode zone, crashes in vnlrureclaim
> and vlru_free() and a few other related problems.  Basically, I've
> converted the holdcnt to be a proper ref counting system, while use count
> maintains the traditional vfs use count semantics, which are not really
> compatbile with structure life-time issues.  It looks like a big change
> but it really makes things much simpler.  Briefly, the rules are this:
> 
> 1) vget/grab a use count if you're a normal consumer of the vnode API.
> That goes for syscalls, mmaping, nfs, etc.
> 
> 2) vhold() if you want to prevent a vnode from being recycled while you
> hold a reference to it.  The name cache uses this, as does the vm when
> pages reference the vnode's vm object.  This is also used for vlrureclaim,
> vflush, vtryrecyle, etc. which want to make sure the vnode is not recycled
> while it has a local reference.
> 
> I'll probably add a comment to vnode.h to describe this in more detail.

So how many beers do we owe you now? :-)

-- 
Brian Fundakowski Feldman                           \'[ FreeBSD ]''''''''''\
  <> green at FreeBSD.org                               \  The Power to Serve! \
 Opinions expressed are my own.                       \,,,,,,,,,,,,,,,,,,,,,,\


More information about the cvs-all mailing list