summaryrefslogtreecommitdiff
path: root/libpod/runtime_volume_linux.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-09-23 14:01:29 -0400
committerMatthew Heon <matthew.heon@pm.me>2019-01-04 09:51:09 -0500
commit35361595f36728958e6abb2c37c22d79a776913a (patch)
treea844fb8eb6f8cf44b7619068599c6741c413f527 /libpod/runtime_volume_linux.go
parentd4b2f116018e1d8e6a3c4f80f30db45934428c6b (diff)
downloadpodman-35361595f36728958e6abb2c37c22d79a776913a.tar.gz
podman-35361595f36728958e6abb2c37c22d79a776913a.tar.bz2
podman-35361595f36728958e6abb2c37c22d79a776913a.zip
Remove runtime lockDir and add in-memory lock manager
Remove runtime's lockDir as it is no longer needed after the lock rework. Add a trivial in-memory lock manager for unit testing Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
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