summaryrefslogtreecommitdiff
path: root/libpod/volume_internal.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-02-15 09:34:37 -0500
committerMatthew Heon <matthew.heon@pm.me>2019-02-21 10:51:42 -0500
commitca8ae877c12cbfa368d572ef6700d9e4a23d5b11 (patch)
treeff88667c11ccf69576a85fbccffab68fbc95b326 /libpod/volume_internal.go
parent9353a3e8ec3855f29c552dd1e0134dbaa3031efa (diff)
downloadpodman-ca8ae877c12cbfa368d572ef6700d9e4a23d5b11.tar.gz
podman-ca8ae877c12cbfa368d572ef6700d9e4a23d5b11.tar.bz2
podman-ca8ae877c12cbfa368d572ef6700d9e4a23d5b11.zip
Remove locks from volumes
I was looking into why we have locks in volumes, and I'm fairly convinced they're unnecessary. We don't have a state whose accesses we need to guard with locks and syncs. The only real purpose for the lock was to prevent concurrent removal of the same volume. Looking at the code, concurrent removal ought to be fine with a bit of reordering - one or the other might fail, but we will successfully evict the volume from the state. Also, remove the 'prune' bool from RemoveVolume. None of our other API functions accept it, and it only served to toggle off more verbose error messages. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/volume_internal.go')
-rw-r--r--libpod/volume_internal.go3
1 files changed, 0 insertions, 3 deletions
diff --git a/libpod/volume_internal.go b/libpod/volume_internal.go
index 0de8a2350..35f0ca19d 100644
--- a/libpod/volume_internal.go
+++ b/libpod/volume_internal.go
@@ -18,8 +18,5 @@ func newVolume(runtime *Runtime) (*Volume, error) {
// teardownStorage deletes the volume from volumePath
func (v *Volume) teardownStorage() error {
- if !v.valid {
- return ErrNoSuchVolume
- }
return os.RemoveAll(filepath.Join(v.runtime.config.VolumePath, v.Name()))
}