mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
daemon: refactor isOnlineFSOperationPermitted
It is only applicable to Windows so it does not need to be called from platform-generic code. Fix locking in the Windows implementation. Signed-off-by: Cory Snider <csnider@mirantis.com>
This commit is contained in:
@@ -16,11 +16,6 @@ func (daemon *Daemon) ContainerCopy(name string, res string) (io.ReadCloser, err
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Make sure an online file-system operation is permitted.
|
||||
if err := daemon.isOnlineFSOperationPermitted(ctr); err != nil {
|
||||
return nil, errdefs.System(err)
|
||||
}
|
||||
|
||||
data, err := daemon.containerCopy(ctr, res)
|
||||
if err == nil {
|
||||
return data, nil
|
||||
@@ -40,11 +35,6 @@ func (daemon *Daemon) ContainerStatPath(name string, path string) (stat *types.C
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Make sure an online file-system operation is permitted.
|
||||
if err := daemon.isOnlineFSOperationPermitted(ctr); err != nil {
|
||||
return nil, errdefs.System(err)
|
||||
}
|
||||
|
||||
stat, err = daemon.containerStatPath(ctr, path)
|
||||
if err == nil {
|
||||
return stat, nil
|
||||
@@ -65,11 +55,6 @@ func (daemon *Daemon) ContainerArchivePath(name string, path string) (content io
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
// Make sure an online file-system operation is permitted.
|
||||
if err := daemon.isOnlineFSOperationPermitted(ctr); err != nil {
|
||||
return nil, nil, errdefs.System(err)
|
||||
}
|
||||
|
||||
content, stat, err = daemon.containerArchivePath(ctr, path)
|
||||
if err == nil {
|
||||
return content, stat, nil
|
||||
@@ -93,11 +78,6 @@ func (daemon *Daemon) ContainerExtractToDir(name, path string, copyUIDGID, noOve
|
||||
return err
|
||||
}
|
||||
|
||||
// Make sure an online file-system operation is permitted.
|
||||
if err := daemon.isOnlineFSOperationPermitted(ctr); err != nil {
|
||||
return errdefs.System(err)
|
||||
}
|
||||
|
||||
err = daemon.containerExtractToDir(ctr, path, copyUIDGID, noOverwriteDirNonDir, content)
|
||||
if err == nil {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user