This patch renames DirLock to FileLock (where a file can be a regular file or a
directory), adds a new LockType type to specify if the lock must be on a
directory or on a regular file and checks if the file is valid for the
requested type.
In creating a more general interface to the container dirs a method for
unlocking a DirLock without closing it became necessary.
This should have been added when lock.NewLock() became public.
This also restores atomic lock conversions
* Discard DirLock interface
* Convert private lock struct into public DirLock
* Convert private newLock function to public NewLock
* Introduce receiver-based analogs of all acquisition functions
* Convert existing open+acquire functions to use the public receiver-based
acquistion functions.
This moves to a very basic DirLock interface (which represents only an
active lock), and functions to create the respective lock types
(TryExclusiveLock, TrySharedLock, ...) instead of methods.
Add a simple package to facilitate placing an flock on directories. This
will be use to coordinate state between running containers and rkt
status/gc tools.