From: Jeffrey Altman Date: Sat, 7 Sep 2013 16:26:52 +0000 (-0400) Subject: afs: FreeDCache test afs_blocksDiscarded X-Git-Tag: upstream/1.6.6_pre2^2~22 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=17aacc87dedffde07b2ae44a73cbddff46222159;p=packages%2Fo%2Fopenafs.git afs: FreeDCache test afs_blocksDiscarded For consistency with afs_FlushDCache and afs_DiscardDCache include afs_blocksDiscarded in the free space test. When afs_FreeDCache is called it should be zero. Change-Id: I84a5dea626258c628d24bf647088e2cbfd233c9a Reviewed-on: http://gerrit.openafs.org/10431 Tested-by: BuildBot Reviewed-by: Derrick Brashear Reviewed-by: Marc Dionne Reviewed-by: Benjamin Kaduk Reviewed-by: Stephan Wiesand --- diff --git a/src/afs/afs_dcache.c b/src/afs/afs_dcache.c index 415b349f1..fe801fef9 100644 --- a/src/afs/afs_dcache.c +++ b/src/afs/afs_dcache.c @@ -989,7 +989,7 @@ afs_FlushDCache(struct dcache *adc) } if (afs_WaitForCacheDrain) { - if (afs_blocksUsed <= + if ((afs_blocksUsed - afs_blocksDiscarded) <= PERCENT(CM_CACHESIZEDRAINEDPCT, afs_cacheBlocks)) { afs_WaitForCacheDrain = 0; afs_osi_Wakeup(&afs_WaitForCacheDrain);