FBSD: correct and simplify vcache eviction routines
authorBen Kaduk <kaduk@mit.edu>
Fri, 29 Oct 2010 07:18:02 +0000 (03:18 -0400)
committerDerrick Brashear <shadow@dementia.org>
Fri, 29 Oct 2010 19:04:09 +0000 (12:04 -0700)
commitaad83a30a82407bfa6ac15b49fd31d69b563e898
tree8f1edc8b778b0f5e7b7fb1c88fd8612cc2db7a5b
parentb6367aa84b9d1c7529b6f3a12bbfeacc91384ffb
FBSD: correct and simplify vcache eviction routines

osi_VM_FlushVCache and osi_TryEvictVCache were both attempting
to be wrappers around vgone(), with some checks before hand.
Implement the latter in terms of the former to prevent
code duplication and propagation of incorrect code.

Additionally, correct the locking around vgone().  The
vnode lock must be held, and we must also increase the vnode's
hold count so that it does not disappear out from under us.
As we need the interlock to check the usecount, keep it
locked until we lock the vnode lock, for extra protection.

As an added bonus, we no longer try to call vgonel(), which
is not an exported symbol and merely happened to work due
to the current kernel linker implementation.

Remove some stale comments.

With this change, a parallel buildworld completes on
my four-core machine.

Change-Id: I665607da25518ddd786869b139d87baed8a05e9f
Reviewed-on: http://gerrit.openafs.org/3196
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/afs/FBSD/osi_vcache.c
src/afs/FBSD/osi_vm.c