* sdirno type changed back to int, as GCC does not like to use char
for integer operations (array indexing).
* sizes adjusted to
swap_filen:25
swap_dirn:7
This limits the cache size to
files/cache_dir: 2^24 (
16777216)
cache_dirs : 2^6-1 (63)
* a couple of asserts added to ensure the above limits.
/*
- * $Id: cache_cf.cc,v 1.367 2001/01/07 23:36:37 hno Exp $
+ * $Id: cache_cf.cc,v 1.368 2001/01/09 14:11:14 hno Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
}
}
+ assert(swap->n_configured < 63); /* 7 bits, signed */
+
fs = find_fstype(type_str);
if (fs < 0) {
/* If we get here, we didn't find a matching cache_dir type */
/*
- * $Id: filemap.cc,v 1.36 2000/10/13 08:45:07 wessels Exp $
+ * $Id: filemap.cc,v 1.37 2001/01/09 14:11:15 hno Exp $
*
* DEBUG: section 8 Swap File Bitmap
* AUTHOR: Harvest Derived
int old_sz = fm->nwords * sizeof(*fm->file_map);
void *old_map = fm->file_map;
fm->max_n_files <<= 1;
- assert(fm->max_n_files <= (1 << 30));
+ assert(fm->max_n_files <= (1 << 24)); /* swap_filen is 25 bits, signed */
fm->nwords = fm->max_n_files >> LONG_BIT_SHIFT;
debug(8, 3) ("file_map_grow: creating space for %d files\n", fm->max_n_files);
fm->file_map = xcalloc(fm->nwords, sizeof(*fm->file_map));
/*
- * $Id: structs.h,v 1.377 2001/01/09 01:43:08 hno Exp $
+ * $Id: structs.h,v 1.378 2001/01/09 14:11:15 hno Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
time_t expires;
time_t lastmod;
size_t swap_file_sz;
- sfileno swap_filen:24;
- sdirno swap_dirn:8;
+ sfileno swap_filen:25;
+ sdirno swap_dirn:7;
u_short refcount;
u_short flags;
u_short lock_count; /* Assume < 65536! */
/*
- * $Id: typedefs.h,v 1.118 2001/01/09 01:43:08 hno Exp $
+ * $Id: typedefs.h,v 1.119 2001/01/09 14:11:15 hno Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
typedef unsigned int ping_status_t;
typedef unsigned int swap_status_t;
typedef int sfileno;
-typedef char sdirno;
+typedef int sdirno;
typedef struct {
size_t bytes;