util/disk_cache: use LRU eviction rather than random eviction
authorAlan Swanson <reiver@improbability.net>
Fri, 10 Mar 2017 16:22:51 +0000 (16:22 +0000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Wed, 15 Mar 2017 00:15:11 +0000 (11:15 +1100)
commitaf09b867329bcc5d50c22c2e634f5c5deb51e184
treec937802c3bd6e0db1edec2c2332ccadf1947e0dc
parentc2793e2c890b828c6cb1e9694619255d69a2ca1e
util/disk_cache: use LRU eviction rather than random eviction

Still using fast random selection of two-character subdirectory in
which to check cache files rather than scanning entire cache.

v2: Factor out double strlen call
v3: C99 declaration of variables where used

Reviewed-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/util/disk_cache.c