diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-10-26 20:25:36 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-10-26 20:25:36 +0200 |
commit | 34741aa3e2ee1e67a4cc735b7492aec13f0d822c (patch) | |
tree | c95472a0b9294a7d4ab3a62b03ecc840f7f472ae | |
parent | 8bc8ab83c874847343e695cdd0e25873ad8bc5d4 (diff) |
journal: special case the trivial cache chain cache entry
-rw-r--r-- | src/journal/journal-file.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index 6c9deacf2c..3df099dbd2 100644 --- a/src/journal/journal-file.c +++ b/src/journal/journal-file.c @@ -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 { |