summaryrefslogtreecommitdiff
path: root/layer
diff options
context:
space:
mode:
authorMichael Crosby <crosbymichael@gmail.com>2016-05-17 13:20:28 -0700
committerMichael Crosby <crosbymichael@gmail.com>2016-05-23 16:52:58 -0700
commit8bb4d31b10e4c3abee9ca92535461859bbf25d46 (patch)
tree8828c0cdea79d3ea65f2a3f82fbae5e9f60b7449 /layer
parent36a82c20321936a71b30fcfde8bc6c76d6cc8d1f (diff)
downloaddocker-8bb4d31b10e4c3abee9ca92535461859bbf25d46.tar.gz
Remove mountedLayer Mount and Unmount
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Diffstat (limited to 'layer')
-rw-r--r--layer/layer.go1
-rw-r--r--layer/layer_store.go13
-rw-r--r--layer/layer_test.go5
-rw-r--r--layer/mounted_layer.go12
4 files changed, 3 insertions, 28 deletions
diff --git a/layer/layer.go b/layer/layer.go
index 5100fe2dee..5d3b8c672a 100644
--- a/layer/layer.go
+++ b/layer/layer.go
@@ -174,7 +174,6 @@ type Store interface {
CreateRWLayer(id string, parent ChainID, mountLabel string, initFunc MountInit, storageOpt map[string]string) (RWLayer, error)
GetRWLayer(id string) (RWLayer, error)
GetMountID(id string) (string, error)
- ReinitRWLayer(l RWLayer) error
ReleaseRWLayer(RWLayer) ([]Metadata, error)
Cleanup() error
diff --git a/layer/layer_store.go b/layer/layer_store.go
index f25ef91ac9..8c3d0a4911 100644
--- a/layer/layer_store.go
+++ b/layer/layer_store.go
@@ -495,19 +495,6 @@ func (ls *layerStore) GetMountID(id string) (string, error) {
return mount.mountID, nil
}
-// ReinitRWLayer reinitializes a given mount to the layerstore, specifically
-// initializing the usage count. It should strictly only be used in the
-// daemon's restore path to restore state of live containers.
-func (ls *layerStore) ReinitRWLayer(l RWLayer) error {
- ls.mountL.Lock()
- defer ls.mountL.Unlock()
-
- if _, ok := ls.mounts[l.Name()]; !ok {
- return ErrMountDoesNotExist
- }
- return nil
-}
-
func (ls *layerStore) ReleaseRWLayer(l RWLayer) ([]Metadata, error) {
ls.mountL.Lock()
defer ls.mountL.Unlock()
diff --git a/layer/layer_test.go b/layer/layer_test.go
index 2e4fab5c86..8e6817c96a 100644
--- a/layer/layer_test.go
+++ b/layer/layer_test.go
@@ -174,10 +174,7 @@ func getCachedLayer(l Layer) *roLayer {
}
func getMountLayer(l RWLayer) *mountedLayer {
- if rl, ok := l.(*referencedRWLayer); ok {
- return rl.mountedLayer
- }
- return l.(*mountedLayer)
+ return l.(*referencedRWLayer).mountedLayer
}
func createMetadata(layers ...Layer) []Metadata {
diff --git a/layer/mounted_layer.go b/layer/mounted_layer.go
index 62189c8c20..add33d9f19 100644
--- a/layer/mounted_layer.go
+++ b/layer/mounted_layer.go
@@ -49,14 +49,6 @@ func (ml *mountedLayer) Parent() Layer {
return nil
}
-func (ml *mountedLayer) Mount(mountLabel string) (string, error) {
- return ml.layerStore.driver.Get(ml.mountID, mountLabel)
-}
-
-func (ml *mountedLayer) Unmount() error {
- return ml.layerStore.driver.Put(ml.mountID)
-}
-
func (ml *mountedLayer) Size() (int64, error) {
return ml.layerStore.driver.DiffSize(ml.mountID, ml.cacheParent())
}
@@ -101,11 +93,11 @@ type referencedRWLayer struct {
}
func (rl *referencedRWLayer) Mount(mountLabel string) (string, error) {
- return rl.mountedLayer.Mount(mountLabel)
+ return rl.layerStore.driver.Get(rl.mountedLayer.mountID, mountLabel)
}
// Unmount decrements the activity count and unmounts the underlying layer
// Callers should only call `Unmount` once per call to `Mount`, even on error.
func (rl *referencedRWLayer) Unmount() error {
- return rl.mountedLayer.Unmount()
+ return rl.layerStore.driver.Put(rl.mountedLayer.mountID)
}