From 98688ddf70cbfe21d22e5832b2f50d626b4183e9 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Thu, 7 Oct 2010 13:41:22 -0400 Subject: [PATCH] shakeloosevcaches drop xvcache during dentry ops denote that we slept and drop xvcache while doing dentry flushing. Change-Id: If597e4153bddce4631383d4c2e1da1faacb720a5 Reviewed-on: http://gerrit.openafs.org/2944 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/afs/LINUX/osi_vcache.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/afs/LINUX/osi_vcache.c b/src/afs/LINUX/osi_vcache.c index fbe6fd8..10fb5cf 100644 --- a/src/afs/LINUX/osi_vcache.c +++ b/src/afs/LINUX/osi_vcache.c @@ -22,6 +22,8 @@ osi_TryEvictVCache(struct vcache *avc, int *slept) { /* First, see if we can evict the inode from the dcache */ if (avc != afs_globalVp && VREFCOUNT(avc) > 1 && avc->opens == 0) { + *slept = 1; + ReleaseWriteLock(&afs_xvcache); AFS_GUNLOCK(); spin_lock(&dcache_lock); head = &(AFSTOV(avc))->i_dentry; @@ -49,15 +51,21 @@ restart: spin_unlock(&dcache_lock); inuse: AFS_GLOCK(); + ObtainWriteLock(&afs_xvcache, 733); } /* See if we can evict it from the VLRUQ */ if (VREFCOUNT_GT(avc,0) && !VREFCOUNT_GT(avc,1) && avc->opens == 0 && (avc->f.states & CUnlinkedDel) == 0) { + int didsleep = *slept; code = afs_FlushVCache(avc, slept); + /* flushvcache wipes slept; restore slept if we did before */ + if (didsleep) + *slept = didsleep; + if (code == 0) - return 1; + return 1; } return 0; -- 1.9.4