temp_file: rename hold_lock_file_for_update

Rename hold_lock_file_for_update to lock_temp_file_for_update.

Signed-off-by: Brian Gesiak <modocache@gmail.com>
temp_file: rename hold_lock_file_for_append

Rename hold_lock_file_for_append to lock_temp_file_for_append.

Signed-off-by: Brian Gesiak <modocache@gmail.com>
temp_file: rename hold_locked_index to lock_index_for_update

Signed-off-by: Brian Gesiak <modocache@gmail.com>
tempfile.h: move close_temp_file from cache.h

temp_file structs are used as temporary files to be unlinked
atexit(3). Functions are available to use those files as "locks".

Lock functions use a temp_file with a specific name (the name of
the file with a ".lock" suffix). If a .lock file exists already, the
function usually dies.

Begin moving temp_file functions to tempfile.h, starting with
close_temp_file.

- Add tempfile.h, tempfile.c
- Move close_temp_file from cache.h to tempfile.h
- Include tempfile.h in files that use close_temp_file

Signed-off-by: Brian Gesiak <modocache@gmail.com>
tempfile.h: move commit_temp_file from cache.h

Signed-off-by: Brian Gesiak <modocache@gmail.com>
tempfile.h: move rollback_temp_file from cache.h

Signed-off-by: Brian Gesiak <modocache@gmail.com>
tempfile.h: move struct temp_file from cache.h

Signed-off-by: Brian Gesiak <modocache@gmail.com>
lockfile.c: rename internal lock file functions

Rename internal lock file functions, which now use struct temp_file, to
use "temp file" terminology.

Signed-off-by: Brian Gesiak <modocache@gmail.com>
temp_file: move temp_file functions from lockfile

Signed-off-by: Brian Gesiak <modocache@gmail.com>
temp_file: remove lockfile flags, suffixes

This completes the separation of lock_file and temp_file logic.
tempfile.c makes no reference to lock suffixes or flags.

Signed-off-by: Brian Gesiak <modocache@gmail.com>