journal: special case the trivial cache chain cache entry

This commit is contained in:
Lennart Poettering 2012-10-26 20:25:36 +02:00
parent 8bc8ab83c8
commit 34741aa3e2
1 changed files with 5 additions and 0 deletions

View 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 {