X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fjournal%2Fjournal-file.h;h=211e121d5c6e8997dd6aaddfdb1a3414656f78aa;hb=455971c1493fc6dc3125d235cf4ea6102cac626d;hp=da2ef3b79534b95789143919a9e86657c7f7ac68;hpb=57cd09acf2c63a414aa2131c00a2b3f600eb0133;p=elogind.git diff --git a/src/journal/journal-file.h b/src/journal/journal-file.h index da2ef3b79..211e121d5 100644 --- a/src/journal/journal-file.h +++ b/src/journal/journal-file.h @@ -76,9 +76,9 @@ typedef struct JournalFile { JournalMetrics metrics; MMapCache *mmap; - Hashmap *chain_cache; + OrderedHashmap *chain_cache; -#ifdef HAVE_XZ +#if defined(HAVE_XZ) || defined(HAVE_LZ4) void *compress_buffer; size_t compress_buffer_size; #endif @@ -212,17 +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, s, &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); - uint64_t s = le64toh(o->object.size); - - return mmap_cache_release(f->mmap, f->fd, f->prot, context, offset, s); +static inline int journal_file_object_release(JournalFile *f, void *release_cookie) { + return mmap_cache_release(f->mmap, f->fd, release_cookie); }