MCPcopy Index your code
hub / github.com/google/gvisor / IncRef

Method IncRef

pkg/sentry/pgalloc/pgalloc.go:1171–1179  ·  view source on GitHub ↗

IncRef implements memmap.File.IncRef.

(fr memmap.FileRange, memCgID uint32)

Source from the content-addressed store, hash-verified

1169
1170// IncRef implements memmap.File.IncRef.
1171func (f *MemoryFile) IncRef(fr memmap.FileRange, memCgID uint32) {
1172 if !fr.WellFormed() || fr.Length() == 0 || !hostarch.IsPageAligned(fr.Start) || !hostarch.IsPageAligned(fr.End) {
1173 panic(fmt.Sprintf("invalid range: %v", fr))
1174 }
1175
1176 f.mu.Lock()
1177 defer f.mu.Unlock()
1178 f.incRefLocked(fr)
1179}
1180
1181// Preconditions: f.mu must be locked.
1182func (f *MemoryFile) incRefLocked(fr memmap.FileRange) {

Callers

nothing calls this directly

Calls 6

incRefLockedMethod · 0.95
IsPageAlignedFunction · 0.92
WellFormedMethod · 0.80
LockMethod · 0.65
UnlockMethod · 0.65
LengthMethod · 0.45

Tested by

no test coverage detected