From aa4f70578ec825742567a70213f7acd78a58ce19 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sat, 7 Sep 2013 12:26:52 -0400 Subject: [PATCH] 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 --- src/afs/afs_dcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/afs/afs_dcache.c b/src/afs/afs_dcache.c index 2eaa50d7a5..f7476a0645 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);