MCPcopy Index your code
hub / github.com/moby/moby / RunInFS

Method RunInFS

daemon/containerfs_linux.go:234–242  ·  view source on GitHub ↗

RunInFS synchronously runs fn in the context of the container filesystem and passes through its return value. The container filesystem is only visible to functions called in the same goroutine as fn. Goroutines started from fn will see the host's filesystem.

(ctx context.Context, fn func() error)

Source from the content-addressed store, hash-verified

232// The container filesystem is only visible to functions called in the same
233// goroutine as fn. Goroutines started from fn will see the host's filesystem.
234func (vw *containerFSView) RunInFS(ctx context.Context, fn func() error) error {
235 res := make(chan error)
236 select {
237 case vw.todo <- future{fn: fn, res: res}:
238 case <-ctx.Done():
239 return ctx.Err()
240 }
241 return <-res
242}
243
244// GoInFS starts fn in the container FS. It blocks until fn is started but does
245// not wait until fn returns. An error is returned if ctx is canceled before fn

Callers 2

StatMethod · 0.95
containerExtractToDirMethod · 0.80

Calls 1

ErrMethod · 0.45

Tested by

no test coverage detected