From: Andrew Deason Date: Sun, 20 May 2012 22:16:37 +0000 (-0500) Subject: FBSD: Do not vgone() in osi_VM_FlushVCache X-Git-Tag: openafs-stable-1_8_0pre1~459 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=b656710d30e6227c5bab75805ef422d237359f46;hp=0315bb393fa9429361e27478832e8a4ed68182d4 FBSD: Do not vgone() in osi_VM_FlushVCache osi_VM_FlushVCache just needs to remove VM references to the given vcache; calling vgone() entirely should be unnecessary. Remove the call to vgone() and other osi_TryEvictVCache-ish stuff, and just try to cache_purge the vnode, like the other BSD implementations do. Change-Id: I71d71f137c04d9ef3625f6a8ae22f0ffb90b9637 Reviewed-on: http://gerrit.openafs.org/7433 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot --- diff --git a/src/afs/FBSD/osi_vm.c b/src/afs/FBSD/osi_vm.c index d5d56f7..40ba119 100644 --- a/src/afs/FBSD/osi_vm.c +++ b/src/afs/FBSD/osi_vm.c @@ -99,23 +99,17 @@ osi_VM_FlushVCache(struct vcache *avc, int *slept) return code; } - if ((vp->v_iflag & VI_DOOMED) != 0) { - VI_UNLOCK(vp); - return 0; - } - - /* must hold the vnode before calling vgone() + /* must hold the vnode before calling cache_purge() * This code largely copied from vfs_subr.c:vlrureclaim() */ vholdl(vp); + VI_UNLOCK(vp); + AFS_GUNLOCK(); - *slept = 1; - /* use the interlock while locking, so no one else can DOOM this */ - ilock_vnode(vp); - vgone(vp); - unlock_vnode(vp); + cache_purge(vp); + AFS_GLOCK(); + vdrop(vp); - AFS_GLOCK(); return 0; }