/*
- * $Id: cache_cf.cc,v 1.391 2001/10/10 15:17:39 adrian Exp $
+ * $Id: cache_cf.cc,v 1.392 2001/10/17 13:43:06 hno Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
void
parse_eol(char *volatile *var)
{
- unsigned char *token = strtok(NULL, null_string);
+ unsigned char *token = (unsigned char *) strtok(NULL, null_string);
safe_free(*var);
if (token == NULL)
self_destruct();
token++;
if (!*token)
self_destruct();
- *var = xstrdup(token);
+ *var = xstrdup((char *) token);
}
static void
}
static void
-free_body_size_t(dlink_list * bodylist) //acl_access ** head)
- {
+free_body_size_t(dlink_list * bodylist)
+{
body_size *bs, *tempnode;
bs = (body_size *) bodylist->head;
while (bs) {
/*
- * $Id: store_dir_ufs.cc,v 1.35 2001/07/11 22:29:51 hno Exp $
+ * $Id: store_dir_ufs.cc,v 1.36 2001/10/17 13:43:06 hno Exp $
*
* DEBUG: section 47 Store Directory Routines
* AUTHOR: Duane Wessels
static char *storeUfsDirSwapLogFile(SwapDir *, const char *);
static EVH storeUfsDirRebuildFromDirectory;
static EVH storeUfsDirRebuildFromSwapLog;
-static int storeUfsDirGetNextFile(RebuildState *, int *sfileno, int *size);
+static int storeUfsDirGetNextFile(RebuildState *, sfileno *, int *size);
static StoreEntry *storeUfsDirAddDiskRestore(SwapDir * SD, const cache_key * key,
int file_number,
size_t swap_file_sz,
*/
static int
-storeUfsDirMapBitTest(SwapDir * SD, int fn)
+storeUfsDirMapBitTest(SwapDir * SD, sfileno filn)
{
- sfileno filn = fn;
ufsinfo_t *ufsinfo;
ufsinfo = (ufsinfo_t *) SD->fsdata;
return file_map_bit_test(ufsinfo->map, filn);
StoreEntry *e = NULL;
StoreEntry tmpe;
cache_key key[MD5_DIGEST_CHARS];
- int sfileno = 0;
+ sfileno filn = 0;
int count;
int size;
struct stat sb;
debug(20, 3) ("storeUfsDirRebuildFromDirectory: DIR #%d\n", rb->sd->index);
for (count = 0; count < rb->speed; count++) {
assert(fd == -1);
- fd = storeUfsDirGetNextFile(rb, &sfileno, &size);
+ fd = storeUfsDirGetNextFile(rb, &filn, &size);
if (fd == -2) {
debug(20, 1) ("Done scanning %s swaplog (%d entries)\n",
rb->sd->path, rb->n_read);
if ((++rb->counts.scancount & 0xFFFF) == 0)
debug(20, 3) (" %s %7d files opened so far.\n",
rb->sd->path, rb->counts.scancount);
- debug(20, 9) ("file_in: fd=%d %08X\n", fd, sfileno);
+ debug(20, 9) ("file_in: fd=%d %08X\n", fd, filn);
statCounter.syscalls.disk.reads++;
if (read(fd, hdr_buf, SM_PAGE_SIZE) < 0) {
debug(20, 1) ("storeUfsDirRebuildFromDirectory: read(FD %d): %s\n",
if (tlv_list == NULL) {
debug(20, 1) ("storeUfsDirRebuildFromDirectory: failed to get meta data\n");
/* XXX shouldn't this be a call to storeUfsUnlink ? */
- storeUfsDirUnlinkFile(SD, sfileno);
+ storeUfsDirUnlinkFile(SD, filn);
continue;
}
debug(20, 3) ("storeUfsDirRebuildFromDirectory: successful swap meta unpacking\n");
tlv_list = NULL;
if (storeKeyNull(key)) {
debug(20, 1) ("storeUfsDirRebuildFromDirectory: NULL key\n");
- storeUfsDirUnlinkFile(SD, sfileno);
+ storeUfsDirUnlinkFile(SD, filn);
continue;
}
tmpe.hash.key = key;
} else if (tmpe.swap_file_sz != sb.st_size) {
debug(20, 1) ("storeUfsDirRebuildFromDirectory: SIZE MISMATCH %d!=%d\n",
tmpe.swap_file_sz, (int) sb.st_size);
- storeUfsDirUnlinkFile(SD, sfileno);
+ storeUfsDirUnlinkFile(SD, filn);
continue;
}
if (EBIT_TEST(tmpe.flags, KEY_PRIVATE)) {
- storeUfsDirUnlinkFile(SD, sfileno);
+ storeUfsDirUnlinkFile(SD, filn);
rb->counts.badflags++;
continue;
}
rb->counts.objcount++;
storeEntryDump(&tmpe, 5);
e = storeUfsDirAddDiskRestore(SD, key,
- sfileno,
+ filn,
tmpe.swap_file_sz,
tmpe.expires,
tmpe.timestamp,
}
static int
-storeUfsDirGetNextFile(RebuildState * rb, int *sfileno, int *size)
+storeUfsDirGetNextFile(RebuildState * rb, sfileno *filn_p, int *size)
{
SwapDir *SD = rb->sd;
ufsinfo_t *ufsinfo = (ufsinfo_t *) SD->fsdata;
rb->curlvl1 = 0;
rb->done = 1;
}
- *sfileno = rb->fn;
+ *filn_p = rb->fn;
return fd;
}