util/disk_cache: delete .tmp if target exists
authorGrazvydas Ignotas <notasas@gmail.com>
Sat, 18 Mar 2017 20:58:54 +0000 (22:58 +0200)
committerTimothy Arceri <tarceri@itsqueeze.com>
Sun, 19 Mar 2017 21:24:38 +0000 (08:24 +1100)
commit67911fa4b88aedc709a92c1630c1de9ea3a30d1f
tree78aa03c7b3f475293f1b9ce417c6f27310e66ae7
parentbd93cea69124b91ec278069f2095b4cbfb44cc2f
util/disk_cache: delete .tmp if target exists

At the time of target file check, .tmp file is already created and file
lock is held, so we should remove the .tmp, like in other error paths.

With this, piglit no longer leaves large amount of empty .tmp files
behind, which waste directory entries and may interfere with eviction.

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