]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
I think it was a really bad idea to have both 'fs.blksize' and 'fs.kperblk'
authorwessels <>
Fri, 5 Jan 2001 10:58:18 +0000 (10:58 +0000)
committerwessels <>
Fri, 5 Jan 2001 10:58:18 +0000 (10:58 +0000)
as an optimization.  Its too hard/ugly to make sure they stay
consistent.  This patch removes fs.kperblk.

src/cache_cf.cc
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
src/store_dir.cc
src/structs.h

index 2ed90bed123380b08447dabd7930964fb87c59e8..0711be001d6b76b1f51a7839f8161353ed4b409c 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_cf.cc,v 1.364 2001/01/04 21:09:00 wessels Exp $
+ * $Id: cache_cf.cc,v 1.365 2001/01/05 03:58:18 wessels Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -1017,7 +1017,6 @@ parse_cachedir(cacheSwap * swap)
     sd->max_objsize = maxobjsize;
     /* defaults in case fs implementation fails to set these */
     sd->fs.blksize = 1024;
-    sd->fs.kperblk = 1;
     swap->n_configured++;
     /* Update the max object size */
     update_maxobjsize();
index 6d3624b885ad5a5a2f1696fca572fc82b833ed85..a4f5fa0e18e88c9646546c45c2faa15fcd4153e6 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_aufs.cc,v 1.24 2001/01/05 00:28:22 wessels Exp $
+ * $Id: store_dir_aufs.cc,v 1.25 2001/01/05 03:58:21 wessels Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -370,10 +370,7 @@ storeAufsDirInit(SwapDir * sd)
        eventAdd("storeDirClean", storeAufsDirCleanEvent, NULL, 15.0, 1);
        started_clean_event = 1;
     }
-    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) storeDirGetBlkSize(sd->path, &sd->fs.blksize);
 }
 
 static void
index 9c9b2b41da0db80044d06baaadd6472d834db572..f2e9dcec4873052b659dcaa56f8fabc638a76d2c 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_coss.cc,v 1.14 2001/01/05 00:28:26 wessels Exp $
+ * $Id: store_dir_coss.cc,v 1.15 2001/01/05 03:58:22 wessels Exp $
  *
  * DEBUG: section 81    Store COSS Directory Routines
  * AUTHOR: Eric Stern
@@ -153,10 +153,7 @@ storeCossDirInit(SwapDir * sd)
     storeCossDirRebuild(sd);
     cs->fd = file_open(sd->path, O_RDWR | O_CREAT);
     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) storeDirGetBlkSize(sd->path, &sd->fs.blksize);
 }
 
 void
index de830163f02ac79a5456cb8231324e6ea49703d0..ab8cfff43a5e561b56cb34aa8d45b7d0c22ed67d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_diskd.cc,v 1.31 2001/01/05 00:28:26 wessels Exp $
+ * $Id: store_dir_diskd.cc,v 1.32 2001/01/05 03:58:23 wessels Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -441,10 +441,7 @@ storeDiskdDirInit(SwapDir * sd)
        eventAdd("storeDirClean", storeDiskdDirCleanEvent, NULL, 15.0, 1);
        started_clean_event = 1;
     }
-    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) storeDirGetBlkSize(sd->path, &sd->fs.blksize);
 }
 
 
index b8e2fa7e4cce79d7f76d7bc094e5422836a4e390..c97b6861d1121eed5843632241b944f4a23f5bd5 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_ufs.cc,v 1.23 2001/01/05 00:28:27 wessels Exp $
+ * $Id: store_dir_ufs.cc,v 1.24 2001/01/05 03:58:23 wessels Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -368,10 +368,7 @@ storeUfsDirInit(SwapDir * sd)
        eventAdd("storeDirClean", storeUfsDirCleanEvent, NULL, 15.0, 1);
        started_clean_event = 1;
     }
-    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) storeDirGetBlkSize(sd->path, &sd->fs.blksize);
 }
 
 static void
index 2cea6b3087d71d30c5e09ece763aa9ed38c5d05a..8b28b57c446fc2df6e3344853c867410059c61ea 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir.cc,v 1.121 2001/01/04 21:55:42 wessels Exp $
+ * $Id: store_dir.cc,v 1.122 2001/01/05 03:58:18 wessels Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -259,7 +259,7 @@ void
 storeDirUpdateSwapSize(SwapDir * SD, size_t size, int sign)
 {
     int blks = (size + SD->fs.blksize - 1) / SD->fs.blksize;
-    int k = blks * SD->fs.kperblk * sign;
+    int k = (blks * SD->fs.blksize >> 10) * sign;
     SD->cur_size += k;
     store_swap_size += k;
     if (sign > 0)
@@ -291,8 +291,8 @@ storeDirStats(StoreEntry * sentry)
        SD = &(Config.cacheSwap.swapDirs[i]);
        storeAppendPrintf(sentry, "Store Directory #%d (%s): %s\n", i, SD->type,
            storeSwapDir(i));
-       storeAppendPrintf(sentry, "FS Block Size %d KB\n",
-           SD->fs.kperblk);
+       storeAppendPrintf(sentry, "FS Block Size %d Bytes\n",
+           SD->fs.blksize);
        SD->statfs(SD, sentry);
     }
 }
index 1f22efbbe2980937ec6626e921d1d5853edbe548..ed20849b14194db23dd2b3ccdd74da1e351cc24e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: structs.h,v 1.371 2001/01/04 21:09:02 wessels Exp $
+ * $Id: structs.h,v 1.372 2001/01/05 03:58:18 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -1394,7 +1394,6 @@ struct _SwapDir {
     } log;
     struct {
        int blksize;
-       int kperblk;
     } fs;
     void *fsdata;
 };