]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix storeDirDiskdCheckObj. The loadav calculation was backwards.
authorwessels <>
Wed, 24 Jan 2001 00:27:21 +0000 (00:27 +0000)
committerwessels <>
Wed, 24 Jan 2001 00:27:21 +0000 (00:27 +0000)
Also removed some old, unused code.

src/fs/diskd/store_dir_diskd.cc

index 2bceb8e9a11cd87c94634ee4f0a2f02114c0b4a1..1a93f51f81a8bb4004fd08aa05e35a12e4a78372 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_diskd.cc,v 1.37 2001/01/15 22:37:10 wessels Exp $
+ * $Id: store_dir_diskd.cc,v 1.38 2001/01/23 17:27:21 wessels Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -1543,28 +1543,13 @@ storeDiskdDirMaintain(SwapDir * SD)
 int
 storeDiskdDirCheckObj(SwapDir * SD, const StoreEntry * e)
 {
-    int loadav;
-
     diskdinfo_t *diskdinfo = SD->fsdata;
-#if OLD_UNUSED_CODE
-    if (storeDiskdDirExpiredReferenceAge(SD) < 300) {
-       debug(20, 3) ("storeDiskdDirCheckObj: NO: LRU Age = %d\n",
-           storeDiskdDirExpiredReferenceAge(SD));
-       /* store_check_cachable_hist.no.lru_age_too_low++; */
-       return -1;
-    }
-#endif
-
     /* Check the queue length */
     if (diskdinfo->away >= diskdinfo->magic1)
        return -1;
-
     /* Calculate the storedir load relative to magic2 on a scale of 0 .. 1000 */
-    if (diskdinfo->away == 0)
-       loadav = 0;
-    else
-       loadav = diskdinfo->magic2 * 1000 / diskdinfo->away;
-    return loadav;
+    /* the parse function guarantees magic2 is positivie */
+    return diskdinfo->away * 1000 / diskdinfo->magic2;
 }
 
 /*