From: wessels <> Date: Tue, 3 Oct 2000 21:31:40 +0000 (+0000) Subject: DW: X-Git-Tag: SQUID_3_0_PRE1~1853 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=6d2cd9074ff7bfd82b7525d0092fd39c5703112b;p=thirdparty%2Fsquid.git DW: - replacement should use SwapDir high/low values, not the global ones. --- diff --git a/src/fs/diskd/diskd.cc b/src/fs/diskd/diskd.cc index 5893d8e92f..a5c4a826c6 100644 --- a/src/fs/diskd/diskd.cc +++ b/src/fs/diskd/diskd.cc @@ -1,5 +1,5 @@ /* - * $Id: diskd.cc,v 1.5 2000/06/26 20:17:12 adrian Exp $ + * $Id: diskd.cc,v 1.6 2000/10/03 15:31:40 wessels Exp $ * * DEBUG: section -- External DISKD process implementation. * AUTHOR: Harvest Derived @@ -188,10 +188,11 @@ static int do_unlink(diomsg * r, int len, const char *buf) { #if USE_TRUNCATE - if (truncate(buf, 0) < 0) { + if (truncate(buf, 0) < 0) #else - if (unlink(buf) < 0) { + if (unlink(buf) < 0) #endif + { fprintf(stderr, "%d UNLNK id %d %s: ", (int) mypid, r->id, buf); perror("truncate"); return -errno; diff --git a/src/fs/diskd/store_dir_diskd.cc b/src/fs/diskd/store_dir_diskd.cc index ff09287be1..8a957cc209 100644 --- a/src/fs/diskd/store_dir_diskd.cc +++ b/src/fs/diskd/store_dir_diskd.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir_diskd.cc,v 1.16 2000/07/16 07:28:38 wessels Exp $ + * $Id: store_dir_diskd.cc,v 1.17 2000/10/03 15:31:40 wessels Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -1476,10 +1476,7 @@ storeDiskdDirMaintain(SwapDir * SD) if (store_dirs_rebuilding) { return; } else { - /* XXX FixMe: This should use the cache_dir hig/low values, not the - * global ones - */ - f = (double) (store_swap_size - store_swap_low) / (store_swap_high - store_swap_low); + f = (double) (SD->cur_size - SD->low_size) / (SD->max_size - SD->low_size); f = f < 0.0 ? 0.0 : f > 1.0 ? 1.0 : f; max_scan = (int) (f * 400.0 + 100.0); max_remove = (int) (f * 70.0 + 10.0); @@ -1490,10 +1487,7 @@ storeDiskdDirMaintain(SwapDir * SD) debug(20, 3) ("storeMaintainSwapSpace: f=%f, max_scan=%d, max_remove=%d\n", f, max_scan, max_remove); walker = SD->repl->PurgeInit(SD->repl, max_scan); while (1) { - /* XXX FixMe: This should use the cache_dir hig/low values, not the - * global ones - */ - if (store_swap_size < store_swap_low) + if (SD->cur_size < SD->low_size) break; if (removed >= max_remove) break;