From: wessels <> Date: Fri, 5 Jan 2001 10:58:18 +0000 (+0000) Subject: I think it was a really bad idea to have both 'fs.blksize' and 'fs.kperblk' X-Git-Tag: SQUID_3_0_PRE1~1692 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3abcea5e380564b71fa2ed57794fd5e7cbdcb14b;p=thirdparty%2Fsquid.git I think it was a really bad idea to have both 'fs.blksize' and 'fs.kperblk' as an optimization. Its too hard/ugly to make sure they stay consistent. This patch removes fs.kperblk. --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 2ed90bed12..0711be001d 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -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(); diff --git a/src/fs/aufs/store_dir_aufs.cc b/src/fs/aufs/store_dir_aufs.cc index 6d3624b885..a4f5fa0e18 100644 --- a/src/fs/aufs/store_dir_aufs.cc +++ b/src/fs/aufs/store_dir_aufs.cc @@ -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 diff --git a/src/fs/coss/store_dir_coss.cc b/src/fs/coss/store_dir_coss.cc index 9c9b2b41da..f2e9dcec48 100644 --- a/src/fs/coss/store_dir_coss.cc +++ b/src/fs/coss/store_dir_coss.cc @@ -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 diff --git a/src/fs/diskd/store_dir_diskd.cc b/src/fs/diskd/store_dir_diskd.cc index de830163f0..ab8cfff43a 100644 --- a/src/fs/diskd/store_dir_diskd.cc +++ b/src/fs/diskd/store_dir_diskd.cc @@ -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); } diff --git a/src/fs/ufs/store_dir_ufs.cc b/src/fs/ufs/store_dir_ufs.cc index b8e2fa7e4c..c97b6861d1 100644 --- a/src/fs/ufs/store_dir_ufs.cc +++ b/src/fs/ufs/store_dir_ufs.cc @@ -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 diff --git a/src/store_dir.cc b/src/store_dir.cc index 2cea6b3087..8b28b57c44 100644 --- a/src/store_dir.cc +++ b/src/store_dir.cc @@ -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); } } diff --git a/src/structs.h b/src/structs.h index 1f22efbbe2..ed20849b14 100644 --- a/src/structs.h +++ b/src/structs.h @@ -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; };