chiark / gitweb /
journal: special case the trivial cache chain cache entry
authorLennart Poettering <lennart@poettering.net>
Fri, 26 Oct 2012 18:25:36 +0000 (20:25 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 26 Oct 2012 18:25:36 +0000 (20:25 +0200)
src/journal/journal-file.c

index 6c9deac..3df099d 100644 (file)
@@ -1328,6 +1328,11 @@ static void chain_cache_put(
                 uint64_t total) {
 
         if (!ci) {
+                /* If the chain item to cache for this chain is the
+                 * first one it's not worth caching anything */
+                if (array == first)
+                        return;
+
                 if (hashmap_size(h) >= CHAIN_CACHE_MAX)
                         ci = hashmap_steal_first(h);
                 else {