1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #13536 from Mic92/master

remove redundant mount/unmount calls on commit
This commit is contained in:
Jessie Frazelle 2015-06-01 15:57:14 -07:00
commit 1f472c3768
2 changed files with 0 additions and 10 deletions

View file

@ -23,11 +23,6 @@ func (daemon *Daemon) Commit(container *Container, repository, tag, comment, aut
defer container.Unpause() defer container.Unpause()
} }
if err := container.Mount(); err != nil {
return nil, err
}
defer container.Unmount()
rwTar, err := container.ExportRw() rwTar, err := container.ExportRw()
if err != nil { if err != nil {
return nil, err return nil, err

View file

@ -838,20 +838,15 @@ func (container *Container) verifyDaemonSettings() {
} }
func (container *Container) ExportRw() (archive.Archive, error) { func (container *Container) ExportRw() (archive.Archive, error) {
if err := container.Mount(); err != nil {
return nil, err
}
if container.daemon == nil { if container.daemon == nil {
return nil, fmt.Errorf("Can't load storage driver for unregistered container %s", container.ID) return nil, fmt.Errorf("Can't load storage driver for unregistered container %s", container.ID)
} }
archive, err := container.daemon.Diff(container) archive, err := container.daemon.Diff(container)
if err != nil { if err != nil {
container.Unmount()
return nil, err return nil, err
} }
return ioutils.NewReadCloserWrapper(archive, func() error { return ioutils.NewReadCloserWrapper(archive, func() error {
err := archive.Close() err := archive.Close()
container.Unmount()
return err return err
}), }),
nil nil