X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fqache.c;h=91536bf7a0df2d9d5a259df63680dcb03fafb0c6;hb=1a3cd3005f2a5cda8dbdaaf8f153ae5703845876;hp=095925df54754085cfa9a4365ac378c7d2c03361;hpb=0a3c6e75d7bf2f7d79a1e448c343946f689e6ba1;p=libucw.git diff --git a/lib/qache.c b/lib/qache.c index 095925df..91536bf7 100644 --- a/lib/qache.c +++ b/lib/qache.c @@ -60,7 +60,7 @@ struct qache { int fd; byte *mmap_data; uns file_size; - byte *file_name; + char *file_name; uns locked; }; @@ -68,10 +68,10 @@ struct qache { #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; immap_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 } @@ -128,7 +128,7 @@ enum entry_audit_flags { ET_HASH = 4 }; -static byte * +static char * audit_entries(struct qache *q, byte *entrymap) { uns i, j; @@ -184,7 +184,7 @@ enum block_audit_flags { BT_ALLOC = 2 }; -static byte * +static char * audit_blocks(struct qache *q, byte *entrymap, byte *blockmap) { uns i, j; @@ -226,7 +226,7 @@ audit_blocks(struct qache *q, byte *entrymap, byte *blockmap) return NULL; } -static byte * +static char * do_audit(struct qache *q) { byte *entry_map = xmalloc_zero(q->hdr->max_entries); @@ -255,7 +255,7 @@ qache_open_existing(struct qache *q, struct qache_params *par) return 0; struct stat st; - byte *err = "stat failed"; + char *err = "stat failed"; if (fstat(q->fd, &st) < 0) goto close_and_fail; @@ -727,7 +727,7 @@ qache_debug(struct qache *q) 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); @@ -777,7 +777,7 @@ int main(int argc UNUSED, char **argv UNUSED) 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;