X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fjournal%2Fjournal-file.h;h=fa5b943e46a2f6393ba1fae0ca86449db413d312;hb=bf3d3e2bb7ae2d3854be57f28dd1403c8f7e4c3c;hp=6703b93b89277ae5751039e723e4d0c5c0fc4375;hpb=73f860db9893deab6aebceb53dd7d0deb662e832;p=elogind.git diff --git a/src/journal/journal-file.h b/src/journal/journal-file.h index 6703b93b8..fa5b943e4 100644 --- a/src/journal/journal-file.h +++ b/src/journal/journal-file.h @@ -78,9 +78,9 @@ typedef struct JournalFile { Hashmap *chain_cache; -#ifdef HAVE_XZ +#if defined(HAVE_XZ) || defined(HAVE_LZ4) void *compress_buffer; - uint64_t compress_buffer_size; + size_t compress_buffer_size; #endif #ifdef HAVE_GCRYPT @@ -212,16 +212,14 @@ static unsigned type_to_context(int type) { return type > 0 && type < _OBJECT_TYPE_MAX ? type : 0; } -static inline int journal_file_object_keep(JournalFile *f, Object *o, uint64_t offset) { +static inline int journal_file_object_keep(JournalFile *f, Object *o, uint64_t offset, void **release_cookie) { unsigned context = type_to_context(o->object.type); + uint64_t s = le64toh(o->object.size); return mmap_cache_get(f->mmap, f->fd, f->prot, context, true, - offset, o->object.size, &f->last_stat, NULL); + offset, s, &f->last_stat, NULL, release_cookie); } -static inline int journal_file_object_release(JournalFile *f, Object *o, uint64_t offset) { - unsigned context = type_to_context(o->object.type); - - return mmap_cache_release(f->mmap, f->fd, f->prot, context, - offset, o->object.size); +static inline int journal_file_object_release(JournalFile *f, void *release_cookie) { + return mmap_cache_release(f->mmap, f->fd, release_cookie); }