Simple disk cache: fix inode problem caused by extremely small cache files

On POSIX filesystems, when most of cache files are extremely small, they
are hardly evicted by size limitation of cache and cache can be grow to
maximum inode of the partition.

So make cache watch the current available inodes and update its
limitation on maximum cache files count periodically. Then evict cached
resources not only depending on size limit, but also on count of cached
files limit.

This was originally authored by Yunsik Jang <yunsik.jang@lge.com>

Change-Id: I4216c7602b2cc24fb0f445f8297836acbc08c431
Reviewed-on: https://chromium-review.googlesource.com/964329
Commit-Queue: José Dapena Paz <jose.dapena@lge.com>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545203}

CrOS-Libchrome-Original-Commit: cf7316a4b60e720d08f36018e68365c9f1d2feb7
2 files changed
tree: c5b72b9447da1f3943bd12490371ef69ce472667
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/