storage/pkg
Valentin Rothberg f58686dcce lockfile: implement reader-writer locks
Implement reader-writer locks to allow allow multiple readers to hold
the lock in parallel.

* The locks are still based on fcntl(2).

* Changing the lock from a reader to a writer and vice versa will block
  on the syscall.

* A writer lock can be held only by one process.  To protect against
  concurrent accesses by gourtines within the same process space, use a
  writer mutex.

* Extend the Locker interface with the `RLock()` method to acquire a
  reader lock.  If the lock is set to be read-only, all calls to
  `Lock()` will be redirected to `RLock()`.  A reader lock is only
  released via fcntl(2) when all gourtines within the same process space
  have unlocked it.  This is done via an internal counter which is
  protected (among other things) by an internal state mutex.

* Panic on violations of the lock protocol, namely when calling
  `Unlock()` on an unlocked lock.  This helps detecting violations in
  the code but also protects the storage from corruption.  Doing this
  has revealed some bugs fixed in ealier commits.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-02-15 09:49:44 +01:00
..
archive lockfile: implement reader-writer locks 2019-02-15 09:49:44 +01:00
chrootarchive Move copytar functions from buildah to storage 2019-01-31 15:26:03 +00:00
config Move structs for storage.conf to pkg/config 2019-02-03 21:21:32 -05:00
devicemapper Update packages to match latest code in moby/pkg 2017-09-12 18:00:29 +00:00
directory Fix build on macOS 2018-06-04 15:14:03 +02:00
dmesg Backport moby devmapper driver changes to containers/storage 2017-09-26 20:45:15 +00:00
fileutils Update packages to match latest code in moby/pkg 2017-09-12 18:00:29 +00:00
fsutils Update packages to match latest code in moby/pkg 2017-09-12 18:00:29 +00:00
homedir Update packages to match latest code in moby/pkg 2017-09-12 18:00:29 +00:00
idtools Refactor ParseIDMap, allow parsing multiple maps at once 2018-11-26 20:11:49 +01:00
ioutils Update packages to match latest code in moby/pkg 2017-09-12 18:00:29 +00:00
locker Update packages to match latest code in moby/pkg 2017-09-12 18:00:29 +00:00
longpath Windows: Fixing longpath hanlding of UNC paths. 2015-09-30 19:36:08 -07:00
loopback Update deps to github.com/sirupsen/logrus v1.0.0 2017-08-01 07:25:56 -07:00
mflag Rename: cow/cowman -> storage/oci-storage 2016-07-18 17:35:50 -04:00
mount Don't fail the mounter test because the kernel added options 2019-01-17 14:36:47 -05:00
ostree ostree: new package 2018-06-29 17:58:49 +02:00
parsers Update packages to match latest code in moby/pkg 2017-09-12 18:00:29 +00:00
pools Rename: cow/cowman -> storage/oci-storage 2016-07-18 17:35:50 -04:00
promise Update packages to match latest code in moby/pkg 2017-09-12 18:00:29 +00:00
reexec Update packages to match latest code in moby/pkg 2017-09-12 18:00:29 +00:00
stringid Update packages to match latest code in moby/pkg 2017-09-12 18:00:29 +00:00
stringutils Update packages to match latest code in moby/pkg 2017-09-12 18:00:29 +00:00
system pkg/system: exposed functions need a windows equivalent 2018-05-31 14:31:50 -04:00
testutil Update packages to match latest code in moby/pkg 2017-09-12 18:00:29 +00:00
truncindex Update to match latest code in moby 2018-01-24 15:04:49 +01:00