disk_cache: use block size rather than file size
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 27 Apr 2017 01:15:30 +0000 (11:15 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Thu, 27 Apr 2017 10:44:00 +0000 (20:44 +1000)
commit4e1f3afea9bdeddb0d21f00d25319bce580d80c3
treea437697dad4f28d8f043cc37f13084d8f01857ba
parentce412371513c90bf9156f22c3567ee57750ef264
disk_cache: use block size rather than file size

The majority of cache files are less than 1kb this resulted in us
greatly miscalculating the amount of disk space used by the cache.

Using the number of blocks allocated to the file is more
conservative and less likely to cause issues.

This change will result in cache sizes being miscalculated further
until old items added with the previous calculation have all been
removed. However I don't see anyway around that, the previous
patch should help limit that problem.

Cc: "17.1" <mesa-stable@lists.freedesktop.org>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
src/util/disk_cache.c