(fr memmap.FileRange)
| 1105 | } |
| 1106 | |
| 1107 | func (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 | |
| 1117 | func (f *MemoryFile) decommitFile(fr memmap.FileRange) error { |
| 1118 | // "After a successful call, subsequent reads from this range will |