]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
DW:
authorwessels <>
Thu, 2 Nov 2000 04:48:16 +0000 (04:48 +0000)
committerwessels <>
Thu, 2 Nov 2000 04:48:16 +0000 (04:48 +0000)
 - replacement should use SwapDir high/low values, not the global ones.
   Made this patch for diskd some time ago, but never duplicated the
   patch in all the other fs duplicated code.

src/fs/aufs/store_dir_aufs.cc
src/fs/ufs/store_dir_ufs.cc

index 0a63ce2846eaa4aa470ddeee5ad3c9d597e89f35..5c9e5a0b1aa4f32d69dc5dc5029bf4c79cf9421b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_aufs.cc,v 1.12 2000/11/01 03:35:47 wessels Exp $
+ * $Id: store_dir_aufs.cc,v 1.13 2000/11/01 21:48:16 wessels Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -1307,9 +1307,6 @@ storeAufsDirMaintain(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 = f < 0.0 ? 0.0 : f > 1.0 ? 1.0 : f;
        max_scan = (int) (f * 400.0 + 100.0);
@@ -1322,10 +1319,7 @@ storeAufsDirMaintain(SwapDir * SD)
        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;
index 9d64aa172fee8ddcf0a0b520165451308aa8c64f..e6b7395aced1a3608eb24b80888bc55fb586b9d8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_ufs.cc,v 1.12 2000/11/01 03:35:49 wessels Exp $
+ * $Id: store_dir_ufs.cc,v 1.13 2000/11/01 21:48:18 wessels Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -1305,10 +1305,7 @@ storeUfsDirMaintain(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);
@@ -1319,10 +1316,7 @@ storeUfsDirMaintain(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;