summaryrefslogtreecommitdiff
path: root/libpod/runtime_volume_linux.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-01-04 10:41:05 -0800
committerGitHub <noreply@github.com>2019-01-04 10:41:05 -0800
commitbf5f779331870d31863c486619daae3fcea458eb (patch)
treeaafcacc17883a8df4734bed0aadbaca59a9882fe /libpod/runtime_volume_linux.go
parent6868b5aa1444404113bc6a4582203fbbf89490c2 (diff)
parent56c5c89408f89fc3733692786d66eb44133b2c59 (diff)
downloadpodman-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/runtime_volume_linux.go')
-rw-r--r--libpod/runtime_volume_linux.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/libpod/runtime_volume_linux.go b/libpod/runtime_volume_linux.go
index 5cc0938f0..0727cfedf 100644
--- a/libpod/runtime_volume_linux.go
+++ b/libpod/runtime_volume_linux.go
@@ -8,7 +8,6 @@ import (
"path/filepath"
"strings"
- "github.com/containers/storage"
"github.com/containers/storage/pkg/stringid"
"github.com/opencontainers/selinux/go-selinux/label"
"github.com/pkg/errors"
@@ -68,14 +67,12 @@ func (r *Runtime) newVolume(ctx context.Context, options ...VolumeCreateOption)
}
volume.config.MountPoint = fullVolPath
- // Path our lock file will reside at
- lockPath := filepath.Join(r.lockDir, volume.config.Name)
- // Grab a lockfile at the given path
- lock, err := storage.GetLockfile(lockPath)
+ lock, err := r.lockManager.AllocateLock()
if err != nil {
- return nil, errors.Wrapf(err, "error creating lockfile for new volume")
+ return nil, errors.Wrapf(err, "error allocating lock for new volume")
}
volume.lock = lock
+ volume.config.LockID = volume.lock.ID()
volume.valid = true