From: Jeffrey Altman Date: Sat, 7 Sep 2013 16:26:52 +0000 (-0400) Subject: afs: FreeDCache test afs_blocksDiscarded X-Git-Tag: upstream/1.8.0_pre1^2~951 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=aa4f70578ec825742567a70213f7acd78a58ce19;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: Ic9063280d88eb28d84851cbe6b7e4867a1110659 Reviewed-on: http://gerrit.openafs.org/10232 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/afs/afs_dcache.c b/src/afs/afs_dcache.c index 2eaa50d7a..f7476a064 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);