chiark / gitweb /
journal: consistently allow type==0 to mean "any type"
[elogind.git] / src / journal / journal-file.h
index da2ef3b79534b95789143919a9e86657c7f7ac68..5e8065c5a0fa2890ec4cfd704f2efed2654cc005 100644 (file)
@@ -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
@@ -205,24 +205,3 @@ int journal_file_get_cutoff_realtime_usec(JournalFile *f, usec_t *from, usec_t *
 int journal_file_get_cutoff_monotonic_usec(JournalFile *f, sd_id128_t boot, usec_t *from, usec_t *to);
 
 bool journal_file_rotate_suggested(JournalFile *f, usec_t max_file_usec);
-
-
-static unsigned type_to_context(int type) {
-        /* One context for each type, plus one catch-all for the rest */
-        return type > 0 && type < _OBJECT_TYPE_MAX ? type : 0;
-}
-
-static inline int journal_file_object_keep(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_get(f->mmap, f->fd, f->prot, context, true,
-                              offset, s, &f->last_stat, NULL);
-}
-
-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);
-}