mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 15:30:14 +00:00
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:
parent
796de9fb43
commit
488c7c9785
@ -422,10 +422,16 @@ afs_CacheTruncateDaemon(void)
|
|||||||
for (counter = 0; counter < 10; counter++) {
|
for (counter = 0; counter < 10; counter++) {
|
||||||
space_needed =
|
space_needed =
|
||||||
afs_blocksUsed - afs_blocksDiscarded - cb_lowat;
|
afs_blocksUsed - afs_blocksDiscarded - cb_lowat;
|
||||||
|
if (space_needed < 0)
|
||||||
|
space_needed = 0;
|
||||||
slots_needed =
|
slots_needed =
|
||||||
dc_hiwat - afs_freeDCCount - afs_discardDCCount;
|
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);
|
afs_GetDownD(slots_needed, &space_needed, 0);
|
||||||
if ((space_needed <= 0) && (slots_needed <= 0)) {
|
if ((space_needed <= 0) && (slots_needed <= 0)) {
|
||||||
|
afs_CacheTooFull = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (afs_termState == AFSOP_STOP_TRUNCDAEMON)
|
if (afs_termState == AFSOP_STOP_TRUNCDAEMON)
|
||||||
|
Loading…
Reference in New Issue
Block a user