From: Andrew Deason Date: Sun, 20 May 2012 22:20:54 +0000 (-0500) Subject: FBSD: Drop afs_xvcache for vgone() X-Git-Tag: upstream/1.8.0_pre1^2~458 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=c09785aa036125074db03a799f7dfebb411f4852;p=packages%2Fo%2Fopenafs.git FBSD: Drop afs_xvcache for vgone() For FreeBSD, osi_TryEvictVCache was calling vgone() without dropping afs_xvcache. Prior to aad83a30a82407bfa6ac15b49fd31d69b563e898, this is what osi_TryEvictVCache did, and since the 'slept' pointer represents whether we dropped xvcache (not whether we dropped glock), it seems like this is the intention of the code. Change-Id: Icb8cc86d972d7ca717bd91e250771d90931e1ba7 Reviewed-on: http://gerrit.openafs.org/7434 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot --- diff --git a/src/afs/FBSD/osi_vcache.c b/src/afs/FBSD/osi_vcache.c index 0739d9ce2..69ac7f8f3 100644 --- a/src/afs/FBSD/osi_vcache.c +++ b/src/afs/FBSD/osi_vcache.c @@ -37,7 +37,10 @@ osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) /* must hold the vnode before calling vgone() * This code largely copied from vfs_subr.c:vlrureclaim() */ vholdl(vp); + + ReleaseWriteLock(&afs_xvcache); AFS_GUNLOCK(); + *slept = 1; /* use the interlock while locking, so no one else can DOOM this */ vn_lock(vp, LK_INTERLOCK|LK_EXCLUSIVE|LK_RETRY); @@ -46,6 +49,7 @@ osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) vdrop(vp); AFS_GLOCK(); + ObtainWriteLock(&afs_xvcache, 340); return 1; }