@@ -30,7 +30,7 @@ func (daemon *Daemon) ContainerCopy(name string, res string) (io.ReadCloser, err
3030 res = res [1 :]
3131 }
3232
33- return container . copy ( res )
33+ return daemon . containerCopy ( container , res )
3434}
3535
3636// ContainerStatPath stats the filesystem resource at the specified path in the
@@ -41,7 +41,7 @@ func (daemon *Daemon) ContainerStatPath(name string, path string) (stat *types.C
4141 return nil , err
4242 }
4343
44- return container . StatPath ( path )
44+ return daemon . containerStatPath ( container , path )
4545}
4646
4747// ContainerArchivePath creates an archive of the filesystem resource at the
@@ -53,7 +53,7 @@ func (daemon *Daemon) ContainerArchivePath(name string, path string) (content io
5353 return nil , nil , err
5454 }
5555
56- return container . ArchivePath ( path )
56+ return daemon . containerArchivePath ( container , path )
5757}
5858
5959// ContainerExtractToDir extracts the given archive to the specified location
@@ -68,7 +68,7 @@ func (daemon *Daemon) ContainerExtractToDir(name, path string, noOverwriteDirNon
6868 return err
6969 }
7070
71- return container . ExtractToDir ( path , noOverwriteDirNonDir , content )
71+ return daemon . containerExtractToDir ( container , path , noOverwriteDirNonDir , content )
7272}
7373
7474// resolvePath resolves the given path in the container to a resource on the
@@ -131,16 +131,16 @@ func (container *Container) statPath(resolvedPath, absPath string) (stat *types.
131131 }, nil
132132}
133133
134- // StatPath stats the filesystem resource at the specified path in this
134+ // containerStatPath stats the filesystem resource at the specified path in this
135135// container. Returns stat info about the resource.
136- func (container * Container ) StatPath ( path string ) (stat * types.ContainerPathStat , err error ) {
136+ func (daemon * Daemon ) containerStatPath ( container * Container , path string ) (stat * types.ContainerPathStat , err error ) {
137137 container .Lock ()
138138 defer container .Unlock ()
139139
140- if err = container .Mount (); err != nil {
140+ if err = daemon .Mount (container ); err != nil {
141141 return nil , err
142142 }
143- defer container .Unmount ()
143+ defer daemon .Unmount (container )
144144
145145 err = container .mountVolumes ()
146146 defer container .unmountVolumes (true )
@@ -156,10 +156,10 @@ func (container *Container) StatPath(path string) (stat *types.ContainerPathStat
156156 return container .statPath (resolvedPath , absPath )
157157}
158158
159- // ArchivePath creates an archive of the filesystem resource at the specified
159+ // containerArchivePath creates an archive of the filesystem resource at the specified
160160// path in this container. Returns a tar archive of the resource and stat info
161161// about the resource.
162- func (container * Container ) ArchivePath ( path string ) (content io.ReadCloser , stat * types.ContainerPathStat , err error ) {
162+ func (daemon * Daemon ) containerArchivePath ( container * Container , path string ) (content io.ReadCloser , stat * types.ContainerPathStat , err error ) {
163163 container .Lock ()
164164
165165 defer func () {
@@ -171,7 +171,7 @@ func (container *Container) ArchivePath(path string) (content io.ReadCloser, sta
171171 }
172172 }()
173173
174- if err = container .Mount (); err != nil {
174+ if err = daemon .Mount (container ); err != nil {
175175 return nil , nil , err
176176 }
177177
@@ -180,7 +180,7 @@ func (container *Container) ArchivePath(path string) (content io.ReadCloser, sta
180180 // unmount any volumes
181181 container .unmountVolumes (true )
182182 // unmount the container's rootfs
183- container .Unmount ()
183+ daemon .Unmount (container )
184184 }
185185 }()
186186
@@ -214,7 +214,7 @@ func (container *Container) ArchivePath(path string) (content io.ReadCloser, sta
214214 content = ioutils .NewReadCloserWrapper (data , func () error {
215215 err := data .Close ()
216216 container .unmountVolumes (true )
217- container .Unmount ()
217+ daemon .Unmount (container )
218218 container .Unlock ()
219219 return err
220220 })
@@ -224,20 +224,20 @@ func (container *Container) ArchivePath(path string) (content io.ReadCloser, sta
224224 return content , stat , nil
225225}
226226
227- // ExtractToDir extracts the given tar archive to the specified location in the
227+ // containerExtractToDir extracts the given tar archive to the specified location in the
228228// filesystem of this container. The given path must be of a directory in the
229229// container. If it is not, the error will be ErrExtractPointNotDirectory. If
230230// noOverwriteDirNonDir is true then it will be an error if unpacking the
231231// given content would cause an existing directory to be replaced with a non-
232232// directory and vice versa.
233- func (container * Container ) ExtractToDir ( path string , noOverwriteDirNonDir bool , content io.Reader ) (err error ) {
233+ func (daemon * Daemon ) containerExtractToDir ( container * Container , path string , noOverwriteDirNonDir bool , content io.Reader ) (err error ) {
234234 container .Lock ()
235235 defer container .Unlock ()
236236
237- if err = container .Mount (); err != nil {
237+ if err = daemon .Mount (container ); err != nil {
238238 return err
239239 }
240- defer container .Unmount ()
240+ defer daemon .Unmount (container )
241241
242242 err = container .mountVolumes ()
243243 defer container .unmountVolumes (true )
0 commit comments