int fd;
byte *mmap_data;
uns file_size;
- byte *file_name;
+ char *file_name;
uns locked;
};
#define first_free_block entry_table[0].first_data_block
#define num_free_blocks entry_table[0].data_len
-static inline byte *
+static inline char *
format_key(qache_key_t *key)
{
- static byte keybuf[2*sizeof(qache_key_t)+1];
+ static char keybuf[2*sizeof(qache_key_t)+1];
for (uns i=0; i<sizeof(qache_key_t); i++)
sprintf(keybuf+2*i, "%02x", (*key)[i]);
return keybuf;
start -= start % CPU_PAGE_SIZE;
len = ALIGN_TO(len, CPU_PAGE_SIZE);
if (msync(q->mmap_data + start, len, MS_ASYNC | MS_INVALIDATE) < 0)
- log(L_ERROR, "Cache %s: msync failed: %m", q->file_name);
+ msg(L_ERROR, "Cache %s: msync failed: %m", q->file_name);
#endif
}
ET_HASH = 4
};
-static byte *
+static char *
audit_entries(struct qache *q, byte *entrymap)
{
uns i, j;
BT_ALLOC = 2
};
-static byte *
+static char *
audit_blocks(struct qache *q, byte *entrymap, byte *blockmap)
{
uns i, j;
return NULL;
}
-static byte *
+static char *
do_audit(struct qache *q)
{
byte *entry_map = xmalloc_zero(q->hdr->max_entries);
return 0;
struct stat st;
- byte *err = "stat failed";
+ char *err = "stat failed";
if (fstat(q->fd, &st) < 0)
goto close_and_fail;
void
qache_audit(struct qache *q)
{
- byte *err;
+ char *err;
qache_lock(q);
if (err = do_audit(q))
die("Cache %s: %s", q->file_name, err);
found++;
}
}
- log(L_INFO, "Found %d of %d entries", found, N);
+ msg(L_INFO, "Found %d of %d entries", found, N);
qache_close(q, 1);
return 0;