diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-01-04 10:41:05 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-04 10:41:05 -0800 |
commit | bf5f779331870d31863c486619daae3fcea458eb (patch) | |
tree | aafcacc17883a8df4734bed0aadbaca59a9882fe /libpod/boltdb_state_internal.go | |
parent | 6868b5aa1444404113bc6a4582203fbbf89490c2 (diff) | |
parent | 56c5c89408f89fc3733692786d66eb44133b2c59 (diff) | |
download | podman-bf5f779331870d31863c486619daae3fcea458eb.tar.gz podman-bf5f779331870d31863c486619daae3fcea458eb.tar.bz2 podman-bf5f779331870d31863c486619daae3fcea458eb.zip |
Merge pull request #1235 from mheon/shm_locking
SHM locking for Libpod
Diffstat (limited to 'libpod/boltdb_state_internal.go')
-rw-r--r-- | libpod/boltdb_state_internal.go | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/libpod/boltdb_state_internal.go b/libpod/boltdb_state_internal.go index 06f8dcb24..29a7184c9 100644 --- a/libpod/boltdb_state_internal.go +++ b/libpod/boltdb_state_internal.go @@ -3,7 +3,6 @@ package libpod import ( "bytes" "encoding/json" - "path/filepath" "runtime" "strings" @@ -288,10 +287,9 @@ func (s *BoltState) getContainerFromDB(id []byte, ctr *Container, ctrsBkt *bolt. } // Get the lock - lockPath := filepath.Join(s.runtime.lockDir, string(id)) - lock, err := storage.GetLockfile(lockPath) + lock, err := s.runtime.lockManager.RetrieveLock(ctr.config.LockID) if err != nil { - return errors.Wrapf(err, "error retrieving lockfile for container %s", string(id)) + return errors.Wrapf(err, "error retrieving lock for container %s", string(id)) } ctr.lock = lock @@ -324,10 +322,9 @@ func (s *BoltState) getPodFromDB(id []byte, pod *Pod, podBkt *bolt.Bucket) error } // Get the lock - lockPath := filepath.Join(s.runtime.lockDir, string(id)) - lock, err := storage.GetLockfile(lockPath) + lock, err := s.runtime.lockManager.RetrieveLock(pod.config.LockID) if err != nil { - return errors.Wrapf(err, "error retrieving lockfile for pod %s", string(id)) + return errors.Wrapf(err, "error retrieving lock for pod %s", string(id)) } pod.lock = lock @@ -353,8 +350,7 @@ func (s *BoltState) getVolumeFromDB(name []byte, volume *Volume, volBkt *bolt.Bu } // Get the lock - lockPath := filepath.Join(s.runtime.lockDir, string(name)) - lock, err := storage.GetLockfile(lockPath) + lock, err := s.runtime.lockManager.RetrieveLock(volume.config.LockID) if err != nil { return errors.Wrapf(err, "error retrieving lockfile for volume %s", string(name)) } |