afs: FreeDCache test afs_blocksDiscarded
authorJeffrey Altman <jaltman@your-file-system.com>
Sat, 7 Sep 2013 16:26:52 +0000 (12:26 -0400)
committerDerrick Brashear <shadow@your-file-system.com>
Fri, 1 Nov 2013 21:29:43 +0000 (14:29 -0700)
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 <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

src/afs/afs_dcache.c

index 2eaa50d..f7476a0 100644 (file)
@@ -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);