]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Argh, the FS blocksize code assumed that blocksize would always be
authorwessels <>
Fri, 5 Jan 2001 07:28:22 +0000 (07:28 +0000)
committerwessels <>
Fri, 5 Jan 2001 07:28:22 +0000 (07:28 +0000)
1K or greater.  If the blocksize is 512 bytes, the 'kperblk' variable
would be set to zero, which screws up cache size calculations.

src/fs/aufs/store_dir_aufs.cc
src/fs/coss/store_dir_coss.cc
src/fs/diskd/store_dir_diskd.cc
src/fs/ufs/store_dir_ufs.cc

index 4f7eb6779ffa1806c4f5ab50b1fa87fa01c0d540..6d3624b885ad5a5a2f1696fca572fc82b833ed85 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_aufs.cc,v 1.23 2001/01/02 01:41:33 wessels Exp $
+ * $Id: store_dir_aufs.cc,v 1.24 2001/01/05 00:28:22 wessels Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -372,6 +372,8 @@ storeAufsDirInit(SwapDir * sd)
     }
     if (0 == storeDirGetBlkSize(sd->path, &sd->fs.blksize))
        sd->fs.kperblk = sd->fs.blksize >> 10;
+    if (sd->fs.kperblk < 1)
+       sd->fs.kperblk = 1;
 }
 
 static void
index 72e7f58c63b27bb0fa2a1a72b0f4e7ebb32dd762..9c9b2b41da0db80044d06baaadd6472d834db572 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_coss.cc,v 1.13 2001/01/02 01:41:34 wessels Exp $
+ * $Id: store_dir_coss.cc,v 1.14 2001/01/05 00:28:26 wessels Exp $
  *
  * DEBUG: section 81    Store COSS Directory Routines
  * AUTHOR: Eric Stern
@@ -155,6 +155,8 @@ storeCossDirInit(SwapDir * sd)
     n_coss_dirs++;
     if (0 == storeDirGetBlkSize(sd->path, &sd->fs.blksize))
        sd->fs.kperblk = sd->fs.blksize >> 10;
+    if (sd->fs.kperblk < 1)
+       sd->fs.kperblk = 1;
 }
 
 void
index a4f62295c304554b28215afd99e6e430d85c3a2b..de830163f02ac79a5456cb8231324e6ea49703d0 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_diskd.cc,v 1.30 2001/01/02 01:41:34 wessels Exp $
+ * $Id: store_dir_diskd.cc,v 1.31 2001/01/05 00:28:26 wessels Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -443,6 +443,8 @@ storeDiskdDirInit(SwapDir * sd)
     }
     if (0 == storeDirGetBlkSize(sd->path, &sd->fs.blksize))
        sd->fs.kperblk = sd->fs.blksize >> 10;
+    if (sd->fs.kperblk < 1)
+       sd->fs.kperblk = 1;
 }
 
 
index 0db450a9f7c039cd10ac229cff8014631d3977a3..b8e2fa7e4cce79d7f76d7bc094e5422836a4e390 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_ufs.cc,v 1.22 2001/01/04 03:42:38 wessels Exp $
+ * $Id: store_dir_ufs.cc,v 1.23 2001/01/05 00:28:27 wessels Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -370,6 +370,8 @@ storeUfsDirInit(SwapDir * sd)
     }
     if (0 == storeDirGetBlkSize(sd->path, &sd->fs.blksize))
        sd->fs.kperblk = sd->fs.blksize >> 10;
+    if (sd->fs.kperblk < 1)
+       sd->fs.kperblk = 1;
 }
 
 static void