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

Method commitFile

pkg/sentry/pgalloc/pgalloc.go:1107–1115  ·  view source on GitHub ↗
(fr memmap.FileRange)

Source from the content-addressed store, hash-verified

1105}
1106
1107func (f *MemoryFile) commitFile(fr memmap.FileRange) error {
1108 // "The default operation (i.e., mode is zero) of fallocate() allocates the
1109 // disk space within the range specified by offset and len." - fallocate(2)
1110 return unix.Fallocate(
1111 int(f.file.Fd()),
1112 0, // mode
1113 int64(fr.Start),
1114 int64(fr.Length()))
1115}
1116
1117func (f *MemoryFile) decommitFile(fr memmap.FileRange) error {
1118 // "After a successful call, subsequent reads from this range will

Callers 1

AllocateMethod · 0.95

Calls 1

LengthMethod · 0.45

Tested by

no test coverage detected