]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
DW:
authorwessels <>
Tue, 3 Oct 2000 21:31:40 +0000 (21:31 +0000)
committerwessels <>
Tue, 3 Oct 2000 21:31:40 +0000 (21:31 +0000)
 - replacement should use SwapDir high/low values, not the global ones.

src/fs/diskd/diskd.cc
src/fs/diskd/store_dir_diskd.cc

index 5893d8e92fe11c752ed11477927a34e8b71e0b01..a5c4a826c64f9d6609a7016d71d45ff21b26d935 100644 (file)
@@ -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;
index ff09287be117e4b3c8cf86ce3628ee22ab849c99..8a957cc209a6c969b8ea87b1c83674a8b2a8a946 100644 (file)
@@ -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;