summaryrefslogtreecommitdiff
path: root/libpod/lock/in_memory_locks.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-02-14 17:25:58 -0500
committerMatthew Heon <matthew.heon@pm.me>2019-02-21 10:51:42 -0500
commit7fdd20ae5a1ced1faceab9cb0a6e553343911a0b (patch)
tree21bc568928dfaa8f12e3b616e0e72fda3f1f5a63 /libpod/lock/in_memory_locks.go
parent84feff2e06e9c3dd504be918f8dcf0b0a434a941 (diff)
downloadpodman-7fdd20ae5a1ced1faceab9cb0a6e553343911a0b.tar.gz
podman-7fdd20ae5a1ced1faceab9cb0a6e553343911a0b.tar.bz2
podman-7fdd20ae5a1ced1faceab9cb0a6e553343911a0b.zip
Add initial version of renumber backend
Renumber is a way of renumbering container locks after the number of locks available has changed. For now, renumber only works with containers. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/lock/in_memory_locks.go')
-rw-r--r--libpod/lock/in_memory_locks.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/libpod/lock/in_memory_locks.go b/libpod/lock/in_memory_locks.go
index db8f20e95..7eb22328f 100644
--- a/libpod/lock/in_memory_locks.go
+++ b/libpod/lock/in_memory_locks.go
@@ -89,3 +89,12 @@ func (m *InMemoryManager) RetrieveLock(id uint32) (Locker, error) {
return m.locks[id], nil
}
+
+// FreeAllLocks frees all locks
+func (m *InMemoryManager) FreeAllLocks() error {
+ for _, lock := range m.locks {
+ lock.allocated = false
+ }
+
+ return nil
+}