MCPcopy
hub / github.com/google/gvisor / processDeferredDecRefs

Method processDeferredDecRefs

pkg/sentry/fsimpl/kernfs/kernfs.go:177–186  ·  view source on GitHub ↗

processDeferredDecRefs calls vfs.Dentry.DecRef on all dentries in the deferredDecRefs list. See comment on Filesystem.mu. Precondition: Filesystem.mu or Dentry.dirMu must NOT be locked.

(ctx context.Context)

Source from the content-addressed store, hash-verified

175//
176// Precondition: Filesystem.mu or Dentry.dirMu must NOT be locked.
177func (fs *Filesystem) processDeferredDecRefs(ctx context.Context) {
178 fs.deferredDecRefsMu.Lock()
179 for _, d := range fs.deferredDecRefs {
180 // Defer the DecRef call so that we are not holding deferredDecRefsMu
181 // when DecRef is called.
182 defer d.DecRef(ctx)
183 }
184 fs.deferredDecRefs = fs.deferredDecRefs[:0] // Keep slice memory for reuse.
185 fs.deferredDecRefsMu.Unlock()
186}
187
188// VFSFilesystem returns the generic vfs filesystem object.
189func (fs *Filesystem) VFSFilesystem() *vfs.Filesystem {

Callers 15

AccessAtMethod · 0.95
GetDentryAtMethod · 0.95
GetParentDentryAtMethod · 0.95
LinkAtMethod · 0.95
MkdirAtMethod · 0.95
MknodAtMethod · 0.95
OpenAtMethod · 0.95
ReadlinkAtMethod · 0.95
RenameAtMethod · 0.95
RmdirAtMethod · 0.95
SetStatAtMethod · 0.95
StatAtMethod · 0.95

Calls 3

LockMethod · 0.65
DecRefMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected