afs: don't try GetDownD if nothing to get

if we "need" negative slots or caches, don't run. also,
don't stay "too full"

Change-Id: I29ef8d5fd9844a878d0c804d06aed5862a2d0df4
Reviewed-on: http://gerrit.openafs.org/5612
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
This commit is contained in:
Derrick Brashear 2011-10-12 14:34:55 -04:00
parent 796de9fb43
commit 488c7c9785

View File

@ -422,10 +422,16 @@ afs_CacheTruncateDaemon(void)
for (counter = 0; counter < 10; counter++) {
space_needed =
afs_blocksUsed - afs_blocksDiscarded - cb_lowat;
if (space_needed < 0)
space_needed = 0;
slots_needed =
dc_hiwat - afs_freeDCCount - afs_discardDCCount;
if (slots_needed < 0)
slots_needed = 0;
if (slots_needed || space_needed)
afs_GetDownD(slots_needed, &space_needed, 0);
if ((space_needed <= 0) && (slots_needed <= 0)) {
afs_CacheTooFull = 0;
break;
}
if (afs_termState == AFSOP_STOP_TRUNCDAEMON)