Documentation ¶
Overview ¶
Package fsutil provides utilities for implementing fs.InodeOperations and fs.FileOperations:
- For embeddable utilities, see inode.go and file.go.
- For fs.Inodes that require a page cache to be memory mapped, see inode_cache.go.
- For anon fs.Inodes, see anon.go.
Index ¶
- Constants
- func DirtyzeroNodeSlice(slice []*Dirtynode)
- func DirtyzeroValueSlice(slice []DirtyInfo)
- func FileRangezeroNodeSlice(slice []*FileRangenode)
- func FileRangezeroValueSlice(slice []uint64)
- func FrameRefzeroNodeSlice(slice []*FrameRefnode)
- func FrameRefzeroValueSlice(slice []uint64)
- func GenericConfigureMMap(file *fs.File, m memmap.Mappable, opts *memmap.MMapOpts) error
- func SeekWithDirCursor(ctx context.Context, file *fs.File, whence fs.SeekWhence, offset int64, ...) (int64, error)
- func SyncDirty(ctx context.Context, mr memmap.MappableRange, cache *FileRangeSet, ...) error
- func SyncDirtyAll(ctx context.Context, cache *FileRangeSet, dirty *DirtySet, max uint64, ...) error
- type CachedFileObject
- type CachingInodeOperations
- func (c *CachingInodeOperations) AddMapping(ctx context.Context, ms memmap.MappingSpace, ar hostarch.AddrRange, ...) error
- func (c *CachingInodeOperations) Allocate(ctx context.Context, offset, length int64) error
- func (c *CachingInodeOperations) CopyMapping(ctx context.Context, ms memmap.MappingSpace, srcAR, dstAR hostarch.AddrRange, ...) error
- func (c *CachingInodeOperations) DecLinks(ctx context.Context)
- func (c *CachingInodeOperations) DecRef(fr memmap.FileRange)
- func (c *CachingInodeOperations) Evict(ctx context.Context, er pgalloc.EvictableRange)
- func (c *CachingInodeOperations) FD() int
- func (c *CachingInodeOperations) IncLinks(ctx context.Context)
- func (c *CachingInodeOperations) IncRef(fr memmap.FileRange)
- func (c *CachingInodeOperations) InvalidateUnsavable(ctx context.Context) error
- func (c *CachingInodeOperations) MapInternal(fr memmap.FileRange, at hostarch.AccessType) (safemem.BlockSeq, error)
- func (c *CachingInodeOperations) NotifyChangeFD() error
- func (c *CachingInodeOperations) Read(ctx context.Context, file *fs.File, dst usermem.IOSequence, offset int64) (int64, error)
- func (c *CachingInodeOperations) Release()
- func (c *CachingInodeOperations) RemoveMapping(ctx context.Context, ms memmap.MappingSpace, ar hostarch.AddrRange, ...)
- func (c *CachingInodeOperations) SetOwner(ctx context.Context, inode *fs.Inode, owner fs.FileOwner) error
- func (c *CachingInodeOperations) SetPermissions(ctx context.Context, inode *fs.Inode, perms fs.FilePermissions) bool
- func (c *CachingInodeOperations) SetTimestamps(ctx context.Context, inode *fs.Inode, ts fs.TimeSpec) error
- func (c *CachingInodeOperations) StateFields() []string
- func (c *CachingInodeOperations) StateLoad(stateSourceObject state.Source)
- func (c *CachingInodeOperations) StateSave(stateSinkObject state.Sink)
- func (c *CachingInodeOperations) StateTypeName() string
- func (c *CachingInodeOperations) TouchAccessTime(ctx context.Context, inode *fs.Inode)
- func (c *CachingInodeOperations) TouchModificationAndStatusChangeTime(ctx context.Context)
- func (c *CachingInodeOperations) TouchStatusChangeTime(ctx context.Context)
- func (c *CachingInodeOperations) Translate(ctx context.Context, required, optional memmap.MappableRange, ...) ([]memmap.Translation, error)
- func (c *CachingInodeOperations) Truncate(ctx context.Context, inode *fs.Inode, size int64) error
- func (c *CachingInodeOperations) UnstableAttr(ctx context.Context, inode *fs.Inode) (fs.UnstableAttr, error)
- func (c *CachingInodeOperations) UpdateUnstable(attr fs.UnstableAttr)
- func (c *CachingInodeOperations) Write(ctx context.Context, src usermem.IOSequence, offset int64) (int64, error)
- func (c *CachingInodeOperations) WriteDirtyPagesAndAttrs(ctx context.Context, inode *fs.Inode) error
- func (c *CachingInodeOperations) WriteOut(ctx context.Context, inode *fs.Inode) error
- type CachingInodeOperationsOptions
- type DirFileOperations
- type DirtyGapIterator
- func (gap DirtyGapIterator) End() uint64
- func (gap DirtyGapIterator) IsEmpty() bool
- func (gap DirtyGapIterator) NextGap() DirtyGapIterator
- func (gap DirtyGapIterator) NextLargeEnoughGap(minSize uint64) DirtyGapIterator
- func (gap DirtyGapIterator) NextSegment() DirtyIterator
- func (gap DirtyGapIterator) Ok() bool
- func (gap DirtyGapIterator) PrevGap() DirtyGapIterator
- func (gap DirtyGapIterator) PrevLargeEnoughGap(minSize uint64) DirtyGapIterator
- func (gap DirtyGapIterator) PrevSegment() DirtyIterator
- func (gap DirtyGapIterator) Range() __generics_imported0.MappableRange
- func (gap DirtyGapIterator) Start() uint64
- type DirtyInfo
- type DirtyIterator
- func (seg DirtyIterator) End() uint64
- func (seg DirtyIterator) NextGap() DirtyGapIterator
- func (seg DirtyIterator) NextNonEmpty() (DirtyIterator, DirtyGapIterator)
- func (seg DirtyIterator) NextSegment() DirtyIterator
- func (seg DirtyIterator) Ok() bool
- func (seg DirtyIterator) PrevGap() DirtyGapIterator
- func (seg DirtyIterator) PrevNonEmpty() (DirtyIterator, DirtyGapIterator)
- func (seg DirtyIterator) PrevSegment() DirtyIterator
- func (seg DirtyIterator) Range() __generics_imported0.MappableRange
- func (seg DirtyIterator) SetEnd(end uint64)
- func (seg DirtyIterator) SetEndUnchecked(end uint64)
- func (seg DirtyIterator) SetRange(r __generics_imported0.MappableRange)
- func (seg DirtyIterator) SetRangeUnchecked(r __generics_imported0.MappableRange)
- func (seg DirtyIterator) SetStart(start uint64)
- func (seg DirtyIterator) SetStartUnchecked(start uint64)
- func (seg DirtyIterator) SetValue(val DirtyInfo)
- func (seg DirtyIterator) Start() uint64
- func (seg DirtyIterator) Value() DirtyInfo
- func (seg DirtyIterator) ValuePtr() *DirtyInfo
- type DirtySegmentDataSlices
- type DirtySet
- func (s *DirtySet) Add(r __generics_imported0.MappableRange, val DirtyInfo) bool
- func (s *DirtySet) AddWithoutMerging(r __generics_imported0.MappableRange, val DirtyInfo) bool
- func (ds *DirtySet) AllowClean(mr memmap.MappableRange)
- func (s *DirtySet) ApplyContiguous(r __generics_imported0.MappableRange, fn func(seg DirtyIterator)) DirtyGapIterator
- func (s *DirtySet) ExportSortedSlices() *DirtySegmentDataSlices
- func (s *DirtySet) Find(key uint64) (DirtyIterator, DirtyGapIterator)
- func (s *DirtySet) FindGap(key uint64) DirtyGapIterator
- func (s *DirtySet) FindSegment(key uint64) DirtyIterator
- func (s *DirtySet) FirstGap() DirtyGapIterator
- func (s *DirtySet) FirstSegment() DirtyIterator
- func (s *DirtySet) ImportSortedSlices(sds *DirtySegmentDataSlices) error
- func (s *DirtySet) Insert(gap DirtyGapIterator, r __generics_imported0.MappableRange, val DirtyInfo) DirtyIterator
- func (s *DirtySet) InsertWithoutMerging(gap DirtyGapIterator, r __generics_imported0.MappableRange, val DirtyInfo) DirtyIterator
- func (s *DirtySet) InsertWithoutMergingUnchecked(gap DirtyGapIterator, r __generics_imported0.MappableRange, val DirtyInfo) DirtyIterator
- func (s *DirtySet) IsEmpty() bool
- func (s *DirtySet) IsEmptyRange(r __generics_imported0.MappableRange) bool
- func (s *DirtySet) Isolate(seg DirtyIterator, r __generics_imported0.MappableRange) DirtyIterator
- func (ds *DirtySet) KeepClean(mr memmap.MappableRange)
- func (ds *DirtySet) KeepDirty(mr memmap.MappableRange)
- func (s *DirtySet) LastGap() DirtyGapIterator
- func (s *DirtySet) LastSegment() DirtyIterator
- func (s *DirtySet) LowerBoundGap(min uint64) DirtyGapIterator
- func (s *DirtySet) LowerBoundSegment(min uint64) DirtyIterator
- func (ds *DirtySet) MarkClean(mr memmap.MappableRange)
- func (ds *DirtySet) MarkDirty(mr memmap.MappableRange)
- func (s *DirtySet) Merge(first, second DirtyIterator) DirtyIterator
- func (s *DirtySet) MergeAdjacent(r __generics_imported0.MappableRange)
- func (s *DirtySet) MergeAll()
- func (s *DirtySet) MergeRange(r __generics_imported0.MappableRange)
- func (s *DirtySet) MergeUnchecked(first, second DirtyIterator) DirtyIterator
- func (s *DirtySet) Remove(seg DirtyIterator) DirtyGapIterator
- func (s *DirtySet) RemoveAll()
- func (s *DirtySet) RemoveRange(r __generics_imported0.MappableRange) DirtyGapIterator
- func (s *DirtySet) Span() uint64
- func (s *DirtySet) SpanRange(r __generics_imported0.MappableRange) uint64
- func (s *DirtySet) Split(seg DirtyIterator, split uint64) (DirtyIterator, DirtyIterator)
- func (s *DirtySet) SplitAt(split uint64) bool
- func (s *DirtySet) SplitUnchecked(seg DirtyIterator, split uint64) (DirtyIterator, DirtyIterator)
- func (s *DirtySet) StateFields() []string
- func (s *DirtySet) StateLoad(stateSourceObject state.Source)
- func (s *DirtySet) StateSave(stateSinkObject state.Sink)
- func (s *DirtySet) StateTypeName() string
- func (s *DirtySet) String() string
- func (s *DirtySet) UpperBoundGap(max uint64) DirtyGapIterator
- func (s *DirtySet) UpperBoundSegment(max uint64) DirtyIterator
- type DirtydynamicGap
- type Dirtynode
- type FileGenericSeek
- type FileNoFsync
- type FileNoIoctl
- type FileNoMMap
- type FileNoRead
- type FileNoSeek
- type FileNoSplice
- type FileNoWrite
- type FileNoopFlush
- type FileNoopFsync
- type FileNoopRead
- type FileNoopRelease
- type FileNoopWrite
- type FileNotDirReaddir
- type FilePipeSeek
- type FileRangeGapIterator
- func (gap FileRangeGapIterator) End() uint64
- func (gap FileRangeGapIterator) IsEmpty() bool
- func (gap FileRangeGapIterator) NextGap() FileRangeGapIterator
- func (gap FileRangeGapIterator) NextLargeEnoughGap(minSize uint64) FileRangeGapIterator
- func (gap FileRangeGapIterator) NextSegment() FileRangeIterator
- func (gap FileRangeGapIterator) Ok() bool
- func (gap FileRangeGapIterator) PrevGap() FileRangeGapIterator
- func (gap FileRangeGapIterator) PrevLargeEnoughGap(minSize uint64) FileRangeGapIterator
- func (gap FileRangeGapIterator) PrevSegment() FileRangeIterator
- func (gap FileRangeGapIterator) Range() __generics_imported0.MappableRange
- func (gap FileRangeGapIterator) Start() uint64
- type FileRangeIterator
- func (seg FileRangeIterator) End() uint64
- func (seg FileRangeIterator) FileRange() memmap.FileRange
- func (seg FileRangeIterator) FileRangeOf(mr memmap.MappableRange) memmap.FileRange
- func (seg FileRangeIterator) NextGap() FileRangeGapIterator
- func (seg FileRangeIterator) NextNonEmpty() (FileRangeIterator, FileRangeGapIterator)
- func (seg FileRangeIterator) NextSegment() FileRangeIterator
- func (seg FileRangeIterator) Ok() bool
- func (seg FileRangeIterator) PrevGap() FileRangeGapIterator
- func (seg FileRangeIterator) PrevNonEmpty() (FileRangeIterator, FileRangeGapIterator)
- func (seg FileRangeIterator) PrevSegment() FileRangeIterator
- func (seg FileRangeIterator) Range() __generics_imported0.MappableRange
- func (seg FileRangeIterator) SetEnd(end uint64)
- func (seg FileRangeIterator) SetEndUnchecked(end uint64)
- func (seg FileRangeIterator) SetRange(r __generics_imported0.MappableRange)
- func (seg FileRangeIterator) SetRangeUnchecked(r __generics_imported0.MappableRange)
- func (seg FileRangeIterator) SetStart(start uint64)
- func (seg FileRangeIterator) SetStartUnchecked(start uint64)
- func (seg FileRangeIterator) SetValue(val uint64)
- func (seg FileRangeIterator) Start() uint64
- func (seg FileRangeIterator) Value() uint64
- func (seg FileRangeIterator) ValuePtr() *uint64
- type FileRangeSegmentDataSlices
- type FileRangeSet
- func (s *FileRangeSet) Add(r __generics_imported0.MappableRange, val uint64) bool
- func (s *FileRangeSet) AddWithoutMerging(r __generics_imported0.MappableRange, val uint64) bool
- func (s *FileRangeSet) ApplyContiguous(r __generics_imported0.MappableRange, fn func(seg FileRangeIterator)) FileRangeGapIterator
- func (frs *FileRangeSet) Drop(mr memmap.MappableRange, mf *pgalloc.MemoryFile)
- func (frs *FileRangeSet) DropAll(mf *pgalloc.MemoryFile)
- func (s *FileRangeSet) ExportSortedSlices() *FileRangeSegmentDataSlices
- func (frs *FileRangeSet) Fill(ctx context.Context, required, optional memmap.MappableRange, fileSize uint64, ...) error
- func (s *FileRangeSet) Find(key uint64) (FileRangeIterator, FileRangeGapIterator)
- func (s *FileRangeSet) FindGap(key uint64) FileRangeGapIterator
- func (s *FileRangeSet) FindSegment(key uint64) FileRangeIterator
- func (s *FileRangeSet) FirstGap() FileRangeGapIterator
- func (s *FileRangeSet) FirstSegment() FileRangeIterator
- func (s *FileRangeSet) ImportSortedSlices(sds *FileRangeSegmentDataSlices) error
- func (s *FileRangeSet) Insert(gap FileRangeGapIterator, r __generics_imported0.MappableRange, val uint64) FileRangeIterator
- func (s *FileRangeSet) InsertWithoutMerging(gap FileRangeGapIterator, r __generics_imported0.MappableRange, val uint64) FileRangeIterator
- func (s *FileRangeSet) InsertWithoutMergingUnchecked(gap FileRangeGapIterator, r __generics_imported0.MappableRange, val uint64) FileRangeIterator
- func (s *FileRangeSet) IsEmpty() bool
- func (s *FileRangeSet) IsEmptyRange(r __generics_imported0.MappableRange) bool
- func (s *FileRangeSet) Isolate(seg FileRangeIterator, r __generics_imported0.MappableRange) FileRangeIterator
- func (s *FileRangeSet) LastGap() FileRangeGapIterator
- func (s *FileRangeSet) LastSegment() FileRangeIterator
- func (s *FileRangeSet) LowerBoundGap(min uint64) FileRangeGapIterator
- func (s *FileRangeSet) LowerBoundSegment(min uint64) FileRangeIterator
- func (s *FileRangeSet) Merge(first, second FileRangeIterator) FileRangeIterator
- func (s *FileRangeSet) MergeAdjacent(r __generics_imported0.MappableRange)
- func (s *FileRangeSet) MergeAll()
- func (s *FileRangeSet) MergeRange(r __generics_imported0.MappableRange)
- func (s *FileRangeSet) MergeUnchecked(first, second FileRangeIterator) FileRangeIterator
- func (s *FileRangeSet) Remove(seg FileRangeIterator) FileRangeGapIterator
- func (s *FileRangeSet) RemoveAll()
- func (s *FileRangeSet) RemoveRange(r __generics_imported0.MappableRange) FileRangeGapIterator
- func (s *FileRangeSet) Span() uint64
- func (s *FileRangeSet) SpanRange(r __generics_imported0.MappableRange) uint64
- func (s *FileRangeSet) Split(seg FileRangeIterator, split uint64) (FileRangeIterator, FileRangeIterator)
- func (s *FileRangeSet) SplitAt(split uint64) bool
- func (s *FileRangeSet) SplitUnchecked(seg FileRangeIterator, split uint64) (FileRangeIterator, FileRangeIterator)
- func (s *FileRangeSet) StateFields() []string
- func (s *FileRangeSet) StateLoad(stateSourceObject state.Source)
- func (s *FileRangeSet) StateSave(stateSinkObject state.Sink)
- func (s *FileRangeSet) StateTypeName() string
- func (s *FileRangeSet) String() string
- func (frs *FileRangeSet) Truncate(end uint64, mf *pgalloc.MemoryFile)
- func (s *FileRangeSet) UpperBoundGap(max uint64) FileRangeGapIterator
- func (s *FileRangeSet) UpperBoundSegment(max uint64) FileRangeIterator
- type FileRangeSetFunctions
- func (FileRangeSetFunctions) ClearValue(_ *uint64)
- func (FileRangeSetFunctions) MaxKey() uint64
- func (FileRangeSetFunctions) Merge(mr1 memmap.MappableRange, frstart1 uint64, _ memmap.MappableRange, ...) (uint64, bool)
- func (FileRangeSetFunctions) MinKey() uint64
- func (FileRangeSetFunctions) Split(mr memmap.MappableRange, frstart uint64, split uint64) (uint64, uint64)
- type FileRangedynamicGap
- type FileRangenode
- type FileStaticContentReader
- func (scr *FileStaticContentReader) Read(ctx context.Context, _ *fs.File, dst usermem.IOSequence, offset int64) (int64, error)
- func (scr *FileStaticContentReader) StateFields() []string
- func (scr *FileStaticContentReader) StateLoad(stateSourceObject state.Source)
- func (scr *FileStaticContentReader) StateSave(stateSinkObject state.Sink)
- func (scr *FileStaticContentReader) StateTypeName() string
- type FileUseInodeUnstableAttr
- type FileZeroSeek
- type FrameRefGapIterator
- func (gap FrameRefGapIterator) End() uint64
- func (gap FrameRefGapIterator) IsEmpty() bool
- func (gap FrameRefGapIterator) NextGap() FrameRefGapIterator
- func (gap FrameRefGapIterator) NextLargeEnoughGap(minSize uint64) FrameRefGapIterator
- func (gap FrameRefGapIterator) NextSegment() FrameRefIterator
- func (gap FrameRefGapIterator) Ok() bool
- func (gap FrameRefGapIterator) PrevGap() FrameRefGapIterator
- func (gap FrameRefGapIterator) PrevLargeEnoughGap(minSize uint64) FrameRefGapIterator
- func (gap FrameRefGapIterator) PrevSegment() FrameRefIterator
- func (gap FrameRefGapIterator) Range() __generics_imported0.FileRange
- func (gap FrameRefGapIterator) Start() uint64
- type FrameRefIterator
- func (seg FrameRefIterator) End() uint64
- func (seg FrameRefIterator) NextGap() FrameRefGapIterator
- func (seg FrameRefIterator) NextNonEmpty() (FrameRefIterator, FrameRefGapIterator)
- func (seg FrameRefIterator) NextSegment() FrameRefIterator
- func (seg FrameRefIterator) Ok() bool
- func (seg FrameRefIterator) PrevGap() FrameRefGapIterator
- func (seg FrameRefIterator) PrevNonEmpty() (FrameRefIterator, FrameRefGapIterator)
- func (seg FrameRefIterator) PrevSegment() FrameRefIterator
- func (seg FrameRefIterator) Range() __generics_imported0.FileRange
- func (seg FrameRefIterator) SetEnd(end uint64)
- func (seg FrameRefIterator) SetEndUnchecked(end uint64)
- func (seg FrameRefIterator) SetRange(r __generics_imported0.FileRange)
- func (seg FrameRefIterator) SetRangeUnchecked(r __generics_imported0.FileRange)
- func (seg FrameRefIterator) SetStart(start uint64)
- func (seg FrameRefIterator) SetStartUnchecked(start uint64)
- func (seg FrameRefIterator) SetValue(val uint64)
- func (seg FrameRefIterator) Start() uint64
- func (seg FrameRefIterator) Value() uint64
- func (seg FrameRefIterator) ValuePtr() *uint64
- type FrameRefSegmentDataSlices
- type FrameRefSet
- func (s *FrameRefSet) Add(r __generics_imported0.FileRange, val uint64) bool
- func (s *FrameRefSet) AddWithoutMerging(r __generics_imported0.FileRange, val uint64) bool
- func (s *FrameRefSet) ApplyContiguous(r __generics_imported0.FileRange, fn func(seg FrameRefIterator)) FrameRefGapIterator
- func (refs *FrameRefSet) DecRefAndAccount(fr memmap.FileRange)
- func (s *FrameRefSet) ExportSortedSlices() *FrameRefSegmentDataSlices
- func (s *FrameRefSet) Find(key uint64) (FrameRefIterator, FrameRefGapIterator)
- func (s *FrameRefSet) FindGap(key uint64) FrameRefGapIterator
- func (s *FrameRefSet) FindSegment(key uint64) FrameRefIterator
- func (s *FrameRefSet) FirstGap() FrameRefGapIterator
- func (s *FrameRefSet) FirstSegment() FrameRefIterator
- func (s *FrameRefSet) ImportSortedSlices(sds *FrameRefSegmentDataSlices) error
- func (refs *FrameRefSet) IncRefAndAccount(fr memmap.FileRange)
- func (s *FrameRefSet) Insert(gap FrameRefGapIterator, r __generics_imported0.FileRange, val uint64) FrameRefIterator
- func (s *FrameRefSet) InsertWithoutMerging(gap FrameRefGapIterator, r __generics_imported0.FileRange, val uint64) FrameRefIterator
- func (s *FrameRefSet) InsertWithoutMergingUnchecked(gap FrameRefGapIterator, r __generics_imported0.FileRange, val uint64) FrameRefIterator
- func (s *FrameRefSet) IsEmpty() bool
- func (s *FrameRefSet) IsEmptyRange(r __generics_imported0.FileRange) bool
- func (s *FrameRefSet) Isolate(seg FrameRefIterator, r __generics_imported0.FileRange) FrameRefIterator
- func (s *FrameRefSet) LastGap() FrameRefGapIterator
- func (s *FrameRefSet) LastSegment() FrameRefIterator
- func (s *FrameRefSet) LowerBoundGap(min uint64) FrameRefGapIterator
- func (s *FrameRefSet) LowerBoundSegment(min uint64) FrameRefIterator
- func (s *FrameRefSet) Merge(first, second FrameRefIterator) FrameRefIterator
- func (s *FrameRefSet) MergeAdjacent(r __generics_imported0.FileRange)
- func (s *FrameRefSet) MergeAll()
- func (s *FrameRefSet) MergeRange(r __generics_imported0.FileRange)
- func (s *FrameRefSet) MergeUnchecked(first, second FrameRefIterator) FrameRefIterator
- func (s *FrameRefSet) Remove(seg FrameRefIterator) FrameRefGapIterator
- func (s *FrameRefSet) RemoveAll()
- func (s *FrameRefSet) RemoveRange(r __generics_imported0.FileRange) FrameRefGapIterator
- func (s *FrameRefSet) Span() uint64
- func (s *FrameRefSet) SpanRange(r __generics_imported0.FileRange) uint64
- func (s *FrameRefSet) Split(seg FrameRefIterator, split uint64) (FrameRefIterator, FrameRefIterator)
- func (s *FrameRefSet) SplitAt(split uint64) bool
- func (s *FrameRefSet) SplitUnchecked(seg FrameRefIterator, split uint64) (FrameRefIterator, FrameRefIterator)
- func (s *FrameRefSet) StateFields() []string
- func (s *FrameRefSet) StateLoad(stateSourceObject state.Source)
- func (s *FrameRefSet) StateSave(stateSinkObject state.Sink)
- func (s *FrameRefSet) StateTypeName() string
- func (s *FrameRefSet) String() string
- func (s *FrameRefSet) UpperBoundGap(max uint64) FrameRefGapIterator
- func (s *FrameRefSet) UpperBoundSegment(max uint64) FrameRefIterator
- type FrameRefSetFunctions
- func (FrameRefSetFunctions) ClearValue(val *uint64)
- func (FrameRefSetFunctions) MaxKey() uint64
- func (FrameRefSetFunctions) Merge(_ memmap.FileRange, val1 uint64, _ memmap.FileRange, val2 uint64) (uint64, bool)
- func (FrameRefSetFunctions) MinKey() uint64
- func (FrameRefSetFunctions) Split(_ memmap.FileRange, val uint64, _ uint64) (uint64, uint64)
- type FrameRefdynamicGap
- type FrameRefnode
- type HostFileMapper
- func (f *HostFileMapper) DecRefOn(mr memmap.MappableRange)
- func (f *HostFileMapper) IncRefOn(mr memmap.MappableRange)
- func (f *HostFileMapper) Init()
- func (f *HostFileMapper) IsInited() bool
- func (f *HostFileMapper) MapInternal(fr memmap.FileRange, fd int, write bool) (safemem.BlockSeq, error)
- func (f *HostFileMapper) RegenerateMappings(fd int) error
- func (f *HostFileMapper) StateFields() []string
- func (f *HostFileMapper) StateLoad(stateSourceObject state.Source)
- func (f *HostFileMapper) StateSave(stateSinkObject state.Sink)
- func (f *HostFileMapper) StateTypeName() string
- func (f *HostFileMapper) UnmapAll()
- type HostMappable
- func (h *HostMappable) AddMapping(ctx context.Context, ms memmap.MappingSpace, ar hostarch.AddrRange, ...) error
- func (h *HostMappable) Allocate(ctx context.Context, offset int64, length int64) error
- func (h *HostMappable) CopyMapping(ctx context.Context, ms memmap.MappingSpace, srcAR, dstAR hostarch.AddrRange, ...) error
- func (h *HostMappable) DecRef(fr memmap.FileRange)
- func (h *HostMappable) FD() int
- func (h *HostMappable) IncRef(fr memmap.FileRange)
- func (h *HostMappable) InvalidateUnsavable(_ context.Context) error
- func (h *HostMappable) MapInternal(fr memmap.FileRange, at hostarch.AccessType) (safemem.BlockSeq, error)
- func (h *HostMappable) NotifyChangeFD() error
- func (h *HostMappable) RemoveMapping(ctx context.Context, ms memmap.MappingSpace, ar hostarch.AddrRange, ...)
- func (h *HostMappable) StateFields() []string
- func (h *HostMappable) StateLoad(stateSourceObject state.Source)
- func (h *HostMappable) StateSave(stateSinkObject state.Sink)
- func (h *HostMappable) StateTypeName() string
- func (h *HostMappable) Translate(ctx context.Context, required, optional memmap.MappableRange, ...) ([]memmap.Translation, error)
- func (h *HostMappable) Truncate(ctx context.Context, newSize int64) error
- func (h *HostMappable) Write(ctx context.Context, src usermem.IOSequence, offset int64) (int64, error)
- type InodeDenyWriteChecker
- type InodeGenericChecker
- type InodeIsDirAllocate
- type InodeIsDirTruncate
- type InodeNoExtendedAttributes
- func (InodeNoExtendedAttributes) GetXattr(context.Context, *fs.Inode, string, uint64) (string, error)
- func (InodeNoExtendedAttributes) ListXattr(context.Context, *fs.Inode, uint64) (map[string]struct{}, error)
- func (InodeNoExtendedAttributes) RemoveXattr(context.Context, *fs.Inode, string) error
- func (InodeNoExtendedAttributes) SetXattr(context.Context, *fs.Inode, string, string, uint32) error
- type InodeNoStatFS
- type InodeNoopAllocate
- type InodeNoopRelease
- type InodeNoopTruncate
- type InodeNoopWriteOut
- type InodeNotAllocatable
- type InodeNotDirectory
- func (InodeNotDirectory) Bind(context.Context, *fs.Inode, string, transport.BoundEndpoint, ...) (*fs.Dirent, error)
- func (InodeNotDirectory) Create(context.Context, *fs.Inode, string, fs.FileFlags, fs.FilePermissions) (*fs.File, error)
- func (InodeNotDirectory) CreateDirectory(context.Context, *fs.Inode, string, fs.FilePermissions) error
- func (InodeNotDirectory) CreateFifo(context.Context, *fs.Inode, string, fs.FilePermissions) error
- func (InodeNotDirectory) CreateHardLink(context.Context, *fs.Inode, *fs.Inode, string) error
- func (InodeNotDirectory) CreateLink(context.Context, *fs.Inode, string, string) error
- func (InodeNotDirectory) Lookup(context.Context, *fs.Inode, string) (*fs.Dirent, error)
- func (InodeNotDirectory) Remove(context.Context, *fs.Inode, string) error
- func (InodeNotDirectory) RemoveDirectory(context.Context, *fs.Inode, string) error
- func (InodeNotDirectory) Rename(context.Context, *fs.Inode, *fs.Inode, string, *fs.Inode, string, bool) error
- type InodeNotMappable
- type InodeNotOpenable
- type InodeNotRenameable
- type InodeNotSocket
- type InodeNotSymlink
- type InodeNotTruncatable
- type InodeNotVirtual
- type InodeSimpleAttributes
- func (i *InodeSimpleAttributes) AddLink()
- func (i *InodeSimpleAttributes) DropLink()
- func (i *InodeSimpleAttributes) NotifyAccess(ctx context.Context)
- func (i *InodeSimpleAttributes) NotifyModification(ctx context.Context)
- func (i *InodeSimpleAttributes) NotifyModificationAndStatusChange(ctx context.Context)
- func (i *InodeSimpleAttributes) NotifyStatusChange(ctx context.Context)
- func (i *InodeSimpleAttributes) SetOwner(ctx context.Context, _ *fs.Inode, owner fs.FileOwner) error
- func (i *InodeSimpleAttributes) SetPermissions(ctx context.Context, _ *fs.Inode, p fs.FilePermissions) bool
- func (i *InodeSimpleAttributes) SetTimestamps(ctx context.Context, _ *fs.Inode, ts fs.TimeSpec) error
- func (i *InodeSimpleAttributes) StatFS(context.Context) (fs.Info, error)
- func (i *InodeSimpleAttributes) StateFields() []string
- func (i *InodeSimpleAttributes) StateLoad(stateSourceObject state.Source)
- func (i *InodeSimpleAttributes) StateSave(stateSinkObject state.Sink)
- func (i *InodeSimpleAttributes) StateTypeName() string
- func (i *InodeSimpleAttributes) UnstableAttr(ctx context.Context, _ *fs.Inode) (fs.UnstableAttr, error)
- type InodeSimpleExtendedAttributes
- func (i *InodeSimpleExtendedAttributes) GetXattr(_ context.Context, _ *fs.Inode, name string, _ uint64) (string, error)
- func (i *InodeSimpleExtendedAttributes) ListXattr(context.Context, *fs.Inode, uint64) (map[string]struct{}, error)
- func (i *InodeSimpleExtendedAttributes) RemoveXattr(_ context.Context, _ *fs.Inode, name string) error
- func (i *InodeSimpleExtendedAttributes) SetXattr(_ context.Context, _ *fs.Inode, name, value string, flags uint32) error
- func (i *InodeSimpleExtendedAttributes) StateFields() []string
- func (i *InodeSimpleExtendedAttributes) StateLoad(stateSourceObject state.Source)
- func (i *InodeSimpleExtendedAttributes) StateSave(stateSinkObject state.Sink)
- func (i *InodeSimpleExtendedAttributes) StateTypeName() string
- type InodeStaticFileGetter
- func (i *InodeStaticFileGetter) GetFile(ctx context.Context, dirent *fs.Dirent, flags fs.FileFlags) (*fs.File, error)
- func (i *InodeStaticFileGetter) StateFields() []string
- func (i *InodeStaticFileGetter) StateLoad(stateSourceObject state.Source)
- func (i *InodeStaticFileGetter) StateSave(stateSinkObject state.Sink)
- func (i *InodeStaticFileGetter) StateTypeName() string
- type InodeVirtual
- type NoReadWriteFile
- type NoReadWriteFileInode
- func (*NoReadWriteFileInode) GetFile(ctx context.Context, dirent *fs.Dirent, flags fs.FileFlags) (*fs.File, error)
- func (n *NoReadWriteFileInode) StateFields() []string
- func (n *NoReadWriteFileInode) StateLoad(stateSourceObject state.Source)
- func (n *NoReadWriteFileInode) StateSave(stateSinkObject state.Sink)
- func (n *NoReadWriteFileInode) StateTypeName() string
- type SimpleFileInode
- type StaticDirFileOperations
- func (sdfo *StaticDirFileOperations) IterateDir(ctx context.Context, d *fs.Dirent, dirCtx *fs.DirCtx, offset int) (int, error)
- func (sdfo *StaticDirFileOperations) Readdir(ctx context.Context, file *fs.File, serializer fs.DentrySerializer) (int64, error)
- func (sdfo *StaticDirFileOperations) StateFields() []string
- func (sdfo *StaticDirFileOperations) StateLoad(stateSourceObject state.Source)
- func (sdfo *StaticDirFileOperations) StateSave(stateSinkObject state.Sink)
- func (sdfo *StaticDirFileOperations) StateTypeName() string
Constants ¶
const ( // minDegree is the minimum degree of an internal node in a Set B-tree. // // - Any non-root node has at least minDegree-1 segments. // // - Any non-root internal (non-leaf) node has at least minDegree children. // // - The root node may have fewer than minDegree-1 segments, but it may // only have 0 segments if the tree is empty. // // Our implementation requires minDegree >= 3. Higher values of minDegree // usually improve performance, but increase memory usage for small sets. DirtyminDegree = 3 DirtymaxDegree = 2 * DirtyminDegree )
const ( // minDegree is the minimum degree of an internal node in a Set B-tree. // // - Any non-root node has at least minDegree-1 segments. // // - Any non-root internal (non-leaf) node has at least minDegree children. // // - The root node may have fewer than minDegree-1 segments, but it may // only have 0 segments if the tree is empty. // // Our implementation requires minDegree >= 3. Higher values of minDegree // usually improve performance, but increase memory usage for small sets. FileRangeminDegree = 3 FileRangemaxDegree = 2 * FileRangeminDegree )
const ( // minDegree is the minimum degree of an internal node in a Set B-tree. // // - Any non-root node has at least minDegree-1 segments. // // - Any non-root internal (non-leaf) node has at least minDegree children. // // - The root node may have fewer than minDegree-1 segments, but it may // only have 0 segments if the tree is empty. // // Our implementation requires minDegree >= 3. Higher values of minDegree // usually improve performance, but increase memory usage for small sets. FrameRefminDegree = 3 FrameRefmaxDegree = 2 * FrameRefminDegree )
const DirtytrackGaps = 0
trackGaps is an optional parameter.
If trackGaps is 1, the Set will track maximum gap size recursively, enabling the GapIterator.{Prev,Next}LargeEnoughGap functions. In this case, Key must be an unsigned integer.
trackGaps must be 0 or 1.
const FileRangetrackGaps = 0
trackGaps is an optional parameter.
If trackGaps is 1, the Set will track maximum gap size recursively, enabling the GapIterator.{Prev,Next}LargeEnoughGap functions. In this case, Key must be an unsigned integer.
trackGaps must be 0 or 1.
const FrameReftrackGaps = 0
trackGaps is an optional parameter.
If trackGaps is 1, the Set will track maximum gap size recursively, enabling the GapIterator.{Prev,Next}LargeEnoughGap functions. In this case, Key must be an unsigned integer.
trackGaps must be 0 or 1.
Variables ¶
This section is empty.
Functions ¶
func DirtyzeroNodeSlice ¶
func DirtyzeroNodeSlice(slice []*Dirtynode)
func DirtyzeroValueSlice ¶
func DirtyzeroValueSlice(slice []DirtyInfo)
func FileRangezeroNodeSlice ¶
func FileRangezeroNodeSlice(slice []*FileRangenode)
func FileRangezeroValueSlice ¶
func FileRangezeroValueSlice(slice []uint64)
func FrameRefzeroNodeSlice ¶
func FrameRefzeroNodeSlice(slice []*FrameRefnode)
func FrameRefzeroValueSlice ¶
func FrameRefzeroValueSlice(slice []uint64)
func GenericConfigureMMap ¶
GenericConfigureMMap implements fs.FileOperations.ConfigureMMap for most filesystems that support memory mapping.
func SeekWithDirCursor ¶
func SeekWithDirCursor(ctx context.Context, file *fs.File, whence fs.SeekWhence, offset int64, dirCursor *string) (int64, error)
SeekWithDirCursor is used to implement fs.FileOperations.Seek. If dirCursor is not nil and the seek was on a directory, the cursor will be updated.
Currently only seeking to 0 on a directory is supported.
FIXME(b/33075855): Lift directory seeking limitations.
func SyncDirty ¶
func SyncDirty(ctx context.Context, mr memmap.MappableRange, cache *FileRangeSet, dirty *DirtySet, max uint64, mem memmap.File, writeAt func(ctx context.Context, srcs safemem.BlockSeq, offset uint64) (uint64, error)) error
SyncDirty passes pages in the range mr that are stored in cache and identified as dirty to writeAt, updating dirty to reflect successful writes. If writeAt returns a successful partial write, SyncDirty will call it repeatedly until all bytes have been written. max is the true size of the cached object; offsets beyond max will not be passed to writeAt, even if they are marked dirty.
func SyncDirtyAll ¶
func SyncDirtyAll(ctx context.Context, cache *FileRangeSet, dirty *DirtySet, max uint64, mem memmap.File, writeAt func(ctx context.Context, srcs safemem.BlockSeq, offset uint64) (uint64, error)) error
SyncDirtyAll passes all pages stored in cache identified as dirty to writeAt, updating dirty to reflect successful writes. If writeAt returns a successful partial write, SyncDirtyAll will call it repeatedly until all bytes have been written. max is the true size of the cached object; offsets beyond max will not be passed to writeAt, even if they are marked dirty.
Types ¶
type CachedFileObject ¶
type CachedFileObject interface { // ReadToBlocksAt reads up to dsts.NumBytes() bytes from the file to dsts, // starting at offset, and returns the number of bytes read. ReadToBlocksAt // may return a partial read without an error. ReadToBlocksAt(ctx context.Context, dsts safemem.BlockSeq, offset uint64) (uint64, error) // WriteFromBlocksAt writes up to srcs.NumBytes() bytes from srcs to the // file, starting at offset, and returns the number of bytes written. // WriteFromBlocksAt may return a partial write without an error. WriteFromBlocksAt(ctx context.Context, srcs safemem.BlockSeq, offset uint64) (uint64, error) // SetMaskedAttributes sets the attributes in attr that are true in // mask on the backing file. If the mask contains only ATime or MTime // and the CachedFileObject has an FD to the file, then this operation // is a noop unless forceSetTimestamps is true. This avoids an extra // RPC to the gofer in the open-read/write-close case, when the // timestamps on the file will be updated by the host kernel for us. // // SetMaskedAttributes may be called at any point, regardless of whether // the file was opened. SetMaskedAttributes(ctx context.Context, mask fs.AttrMask, attr fs.UnstableAttr, forceSetTimestamps bool) error // Allocate allows the caller to reserve disk space for the inode. // It's equivalent to fallocate(2) with 'mode=0'. Allocate(ctx context.Context, offset int64, length int64) error // Sync instructs the remote filesystem to sync the file to stable storage. Sync(ctx context.Context) error // FD returns a host file descriptor. If it is possible for // CachingInodeOperations.AddMapping to have ever been called with writable // = true, the FD must have been opened O_RDWR; otherwise, it may have been // opened O_RDONLY or O_RDWR. (mmap unconditionally requires that mapped // files are readable.) If no host file descriptor is available, FD returns // a negative number. // // For any given CachedFileObject, if FD() ever succeeds (returns a // non-negative number), it must always succeed. // // FD is called iff the file has been memory mapped. This implies that // the file was opened (see fs.InodeOperations.GetFile). FD() int }
CachedFileObject is a file that may require caching.
type CachingInodeOperations ¶
type CachingInodeOperations struct {
// contains filtered or unexported fields
}
CachingInodeOperations caches the metadata and content of a CachedFileObject. It implements a subset of InodeOperations. As a utility it can be used to implement the full set of InodeOperations. Generally it should not be embedded to avoid unexpected inherited behavior.
CachingInodeOperations implements Mappable for the CachedFileObject:
- If CachedFileObject.FD returns a value >= 0 then the file descriptor will be memory mapped on the host.
- Otherwise, the contents of CachedFileObject are buffered into memory managed by the CachingInodeOperations.
Implementations of FileOperations for a CachedFileObject must read and write through CachingInodeOperations using Read and Write respectively.
Implementations of InodeOperations.WriteOut must call Sync to write out in-memory modifications of data and metadata to the CachedFileObject.
+stateify savable
func NewCachingInodeOperations ¶
func NewCachingInodeOperations(ctx context.Context, backingFile CachedFileObject, uattr fs.UnstableAttr, opts CachingInodeOperationsOptions) *CachingInodeOperations
NewCachingInodeOperations returns a new CachingInodeOperations backed by a CachedFileObject and its initial unstable attributes.
func (*CachingInodeOperations) AddMapping ¶
func (c *CachingInodeOperations) AddMapping(ctx context.Context, ms memmap.MappingSpace, ar hostarch.AddrRange, offset uint64, writable bool) error
AddMapping implements memmap.Mappable.AddMapping.
func (*CachingInodeOperations) Allocate ¶
func (c *CachingInodeOperations) Allocate(ctx context.Context, offset, length int64) error
Allocate implements fs.InodeOperations.Allocate.
func (*CachingInodeOperations) CopyMapping ¶
func (c *CachingInodeOperations) CopyMapping(ctx context.Context, ms memmap.MappingSpace, srcAR, dstAR hostarch.AddrRange, offset uint64, writable bool) error
CopyMapping implements memmap.Mappable.CopyMapping.
func (*CachingInodeOperations) DecLinks ¶
func (c *CachingInodeOperations) DecLinks(ctx context.Context)
DecLinks decreases the link count and updates cached modification time.
func (*CachingInodeOperations) DecRef ¶
func (c *CachingInodeOperations) DecRef(fr memmap.FileRange)
DecRef implements memmap.File.DecRef. This is used when we directly map an underlying host fd and CachingInodeOperations is used as the memmap.File during translation.
func (*CachingInodeOperations) Evict ¶
func (c *CachingInodeOperations) Evict(ctx context.Context, er pgalloc.EvictableRange)
Evict implements pgalloc.EvictableMemoryUser.Evict.
func (*CachingInodeOperations) FD ¶
func (c *CachingInodeOperations) FD() int
FD implements memmap.File.FD. This is used when we directly map an underlying host fd and CachingInodeOperations is used as the memmap.File during translation.
func (*CachingInodeOperations) IncLinks ¶
func (c *CachingInodeOperations) IncLinks(ctx context.Context)
IncLinks increases the link count and updates cached modification time.
func (*CachingInodeOperations) IncRef ¶
func (c *CachingInodeOperations) IncRef(fr memmap.FileRange)
IncRef implements memmap.File.IncRef. This is used when we directly map an underlying host fd and CachingInodeOperations is used as the memmap.File during translation.
func (*CachingInodeOperations) InvalidateUnsavable ¶
func (c *CachingInodeOperations) InvalidateUnsavable(ctx context.Context) error
InvalidateUnsavable implements memmap.Mappable.InvalidateUnsavable.
func (*CachingInodeOperations) MapInternal ¶
func (c *CachingInodeOperations) MapInternal(fr memmap.FileRange, at hostarch.AccessType) (safemem.BlockSeq, error)
MapInternal implements memmap.File.MapInternal. This is used when we directly map an underlying host fd and CachingInodeOperations is used as the memmap.File during translation.
func (*CachingInodeOperations) NotifyChangeFD ¶
func (c *CachingInodeOperations) NotifyChangeFD() error
NotifyChangeFD must be called after the file description represented by CachedFileObject.FD() changes.
func (*CachingInodeOperations) Read ¶
func (c *CachingInodeOperations) Read(ctx context.Context, file *fs.File, dst usermem.IOSequence, offset int64) (int64, error)
Read reads from frames and otherwise directly from the backing file into dst starting at offset until dst is full, EOF is reached, or an error is encountered.
Read may partially fill dst and return a nil error.
func (*CachingInodeOperations) Release ¶
func (c *CachingInodeOperations) Release()
Release implements fs.InodeOperations.Release.
func (*CachingInodeOperations) RemoveMapping ¶
func (c *CachingInodeOperations) RemoveMapping(ctx context.Context, ms memmap.MappingSpace, ar hostarch.AddrRange, offset uint64, writable bool)
RemoveMapping implements memmap.Mappable.RemoveMapping.
func (*CachingInodeOperations) SetOwner ¶
func (c *CachingInodeOperations) SetOwner(ctx context.Context, inode *fs.Inode, owner fs.FileOwner) error
SetOwner implements fs.InodeOperations.SetOwner.
func (*CachingInodeOperations) SetPermissions ¶
func (c *CachingInodeOperations) SetPermissions(ctx context.Context, inode *fs.Inode, perms fs.FilePermissions) bool
SetPermissions implements fs.InodeOperations.SetPermissions.
func (*CachingInodeOperations) SetTimestamps ¶
func (c *CachingInodeOperations) SetTimestamps(ctx context.Context, inode *fs.Inode, ts fs.TimeSpec) error
SetTimestamps implements fs.InodeOperations.SetTimestamps.
func (*CachingInodeOperations) StateFields ¶
func (c *CachingInodeOperations) StateFields() []string
func (*CachingInodeOperations) StateLoad ¶
func (c *CachingInodeOperations) StateLoad(stateSourceObject state.Source)
+checklocksignore
func (*CachingInodeOperations) StateSave ¶
func (c *CachingInodeOperations) StateSave(stateSinkObject state.Sink)
+checklocksignore
func (*CachingInodeOperations) StateTypeName ¶
func (c *CachingInodeOperations) StateTypeName() string
func (*CachingInodeOperations) TouchAccessTime ¶
func (c *CachingInodeOperations) TouchAccessTime(ctx context.Context, inode *fs.Inode)
TouchAccessTime updates the cached access time in-place to the current time. It does not update status change time in-place. See mm/filemap.c:do_generic_file_read -> include/linux/h:file_accessed.
func (*CachingInodeOperations) TouchModificationAndStatusChangeTime ¶
func (c *CachingInodeOperations) TouchModificationAndStatusChangeTime(ctx context.Context)
TouchModificationAndStatusChangeTime updates the cached modification and status change times in-place to the current time.
func (*CachingInodeOperations) TouchStatusChangeTime ¶
func (c *CachingInodeOperations) TouchStatusChangeTime(ctx context.Context)
TouchStatusChangeTime updates the cached status change time in-place to the current time.
func (*CachingInodeOperations) Translate ¶
func (c *CachingInodeOperations) Translate(ctx context.Context, required, optional memmap.MappableRange, at hostarch.AccessType) ([]memmap.Translation, error)
Translate implements memmap.Mappable.Translate.
func (*CachingInodeOperations) UnstableAttr ¶
func (c *CachingInodeOperations) UnstableAttr(ctx context.Context, inode *fs.Inode) (fs.UnstableAttr, error)
UnstableAttr implements fs.InodeOperations.UnstableAttr.
func (*CachingInodeOperations) UpdateUnstable ¶
func (c *CachingInodeOperations) UpdateUnstable(attr fs.UnstableAttr)
UpdateUnstable updates the cached unstable attributes. Only non-dirty attributes are updated.
func (*CachingInodeOperations) Write ¶
func (c *CachingInodeOperations) Write(ctx context.Context, src usermem.IOSequence, offset int64) (int64, error)
Write writes to frames and otherwise directly to the backing file from src starting at offset and until src is empty or an error is encountered.
If Write partially fills src, a non-nil error is returned.
func (*CachingInodeOperations) WriteDirtyPagesAndAttrs ¶
func (c *CachingInodeOperations) WriteDirtyPagesAndAttrs(ctx context.Context, inode *fs.Inode) error
WriteDirtyPagesAndAttrs will write the dirty pages and attributes to the gofer without calling Fsync on the remote file.
type CachingInodeOperationsOptions ¶
type CachingInodeOperationsOptions struct { // If ForcePageCache is true, use the sentry page cache even if a host file // descriptor is available. ForcePageCache bool // If LimitHostFDTranslation is true, apply maxFillRange() constraints to // host file descriptor mappings returned by // CachingInodeOperations.Translate(). LimitHostFDTranslation bool }
CachingInodeOperationsOptions configures a CachingInodeOperations.
+stateify savable
func (*CachingInodeOperationsOptions) StateFields ¶
func (c *CachingInodeOperationsOptions) StateFields() []string
func (*CachingInodeOperationsOptions) StateLoad ¶
func (c *CachingInodeOperationsOptions) StateLoad(stateSourceObject state.Source)
+checklocksignore
func (*CachingInodeOperationsOptions) StateSave ¶
func (c *CachingInodeOperationsOptions) StateSave(stateSinkObject state.Sink)
+checklocksignore
func (*CachingInodeOperationsOptions) StateTypeName ¶
func (c *CachingInodeOperationsOptions) StateTypeName() string
type DirFileOperations ¶
type DirFileOperations struct { waiter.AlwaysReady FileGenericSeek FileNoIoctl FileNoMMap FileNoopFlush FileNoopFsync FileNoopRelease FileNoSplice }
DirFileOperations implements most of fs.FileOperations for directories, except for Readdir and UnstableAttr which the embedding type must implement.
type DirtyGapIterator ¶
type DirtyGapIterator struct {
// contains filtered or unexported fields
}
A GapIterator is conceptually one of:
- A pointer to a position between two segments, before the first segment, or after the last segment in a set, called a *gap*; or
- A terminal iterator, which is a sentinel indicating that the end of iteration has been reached.
Note that the gap between two adjacent segments exists (iterators to it are non-terminal), but has a length of zero. GapIterator.IsEmpty returns true for such gaps. An empty set contains a single gap, spanning the entire range of the set's keys.
GapIterators are copyable values and are meaningfully equality-comparable. The zero value of GapIterator is a terminal iterator.
Unless otherwise specified, any mutation of a set invalidates all existing iterators into the set.
func (DirtyGapIterator) End ¶
func (gap DirtyGapIterator) End() uint64
End is equivalent to Range().End, but should be preferred if only the end of the range is needed.
func (DirtyGapIterator) IsEmpty ¶
func (gap DirtyGapIterator) IsEmpty() bool
IsEmpty returns true if the iterated gap is empty (that is, the "gap" is between two adjacent segments.)
func (DirtyGapIterator) NextGap ¶
func (gap DirtyGapIterator) NextGap() DirtyGapIterator
NextGap returns the iterated gap's successor. If no such gap exists, NextGap returns a terminal iterator.
func (DirtyGapIterator) NextLargeEnoughGap ¶
func (gap DirtyGapIterator) NextLargeEnoughGap(minSize uint64) DirtyGapIterator
NextLargeEnoughGap returns the iterated gap's first next gap with larger length than minSize. If not found, return a terminal gap iterator (does NOT include this gap itself).
Precondition: trackGaps must be 1.
func (DirtyGapIterator) NextSegment ¶
func (gap DirtyGapIterator) NextSegment() DirtyIterator
NextSegment returns the segment immediately after the iterated gap. If no such segment exists, NextSegment returns a terminal iterator.
func (DirtyGapIterator) Ok ¶
func (gap DirtyGapIterator) Ok() bool
Ok returns true if the iterator is not terminal. All other methods are only valid for non-terminal iterators.
func (DirtyGapIterator) PrevGap ¶
func (gap DirtyGapIterator) PrevGap() DirtyGapIterator
PrevGap returns the iterated gap's predecessor. If no such gap exists, PrevGap returns a terminal iterator.
func (DirtyGapIterator) PrevLargeEnoughGap ¶
func (gap DirtyGapIterator) PrevLargeEnoughGap(minSize uint64) DirtyGapIterator
PrevLargeEnoughGap returns the iterated gap's first prev gap with larger or equal length than minSize. If not found, return a terminal gap iterator (does NOT include this gap itself).
Precondition: trackGaps must be 1.
func (DirtyGapIterator) PrevSegment ¶
func (gap DirtyGapIterator) PrevSegment() DirtyIterator
PrevSegment returns the segment immediately before the iterated gap. If no such segment exists, PrevSegment returns a terminal iterator.
func (DirtyGapIterator) Range ¶
func (gap DirtyGapIterator) Range() __generics_imported0.MappableRange
Range returns the range spanned by the iterated gap.
func (DirtyGapIterator) Start ¶
func (gap DirtyGapIterator) Start() uint64
Start is equivalent to Range().Start, but should be preferred if only the start of the range is needed.
type DirtyInfo ¶
type DirtyInfo struct { // Keep is true if the represented offset is concurrently writable, such // that writing the data for that offset back to the source does not // guarantee that the offset is clean (since it may be concurrently // rewritten after the writeback). Keep bool }
DirtyInfo is the value type of DirtySet, and represents information about a Mappable offset that is dirty (the cached data for that offset is newer than its source).
+stateify savable
func (*DirtyInfo) StateFields ¶
func (*DirtyInfo) StateTypeName ¶
type DirtyIterator ¶
type DirtyIterator struct {
// contains filtered or unexported fields
}
A Iterator is conceptually one of:
- A pointer to a segment in a set; or
- A terminal iterator, which is a sentinel indicating that the end of iteration has been reached.
Iterators are copyable values and are meaningfully equality-comparable. The zero value of Iterator is a terminal iterator.
Unless otherwise specified, any mutation of a set invalidates all existing iterators into the set.
func DirtysegmentAfterPosition ¶
func DirtysegmentAfterPosition(n *Dirtynode, i int) DirtyIterator
segmentAfterPosition returns the successor segment of the position given by n.children[i], which may or may not contain a child. If no such segment exists, segmentAfterPosition returns a terminal iterator.
func DirtysegmentBeforePosition ¶
func DirtysegmentBeforePosition(n *Dirtynode, i int) DirtyIterator
segmentBeforePosition returns the predecessor segment of the position given by n.children[i], which may or may not contain a child. If no such segment exists, segmentBeforePosition returns a terminal iterator.
func (DirtyIterator) End ¶
func (seg DirtyIterator) End() uint64
End is equivalent to Range().End, but should be preferred if only the end of the range is needed.
func (DirtyIterator) NextGap ¶
func (seg DirtyIterator) NextGap() DirtyGapIterator
NextGap returns the gap immediately after the iterated segment.
func (DirtyIterator) NextNonEmpty ¶
func (seg DirtyIterator) NextNonEmpty() (DirtyIterator, DirtyGapIterator)
NextNonEmpty returns the iterated segment's successor if it is adjacent, or the gap after the iterated segment otherwise. If seg.End() == Functions.MaxKey(), NextNonEmpty will return two terminal iterators. Otherwise, exactly one of the iterators returned by NextNonEmpty will be non-terminal.
func (DirtyIterator) NextSegment ¶
func (seg DirtyIterator) NextSegment() DirtyIterator
NextSegment returns the iterated segment's successor. If there is no succeeding segment, NextSegment returns a terminal iterator.
func (DirtyIterator) Ok ¶
func (seg DirtyIterator) Ok() bool
Ok returns true if the iterator is not terminal. All other methods are only valid for non-terminal iterators.
func (DirtyIterator) PrevGap ¶
func (seg DirtyIterator) PrevGap() DirtyGapIterator
PrevGap returns the gap immediately before the iterated segment.
func (DirtyIterator) PrevNonEmpty ¶
func (seg DirtyIterator) PrevNonEmpty() (DirtyIterator, DirtyGapIterator)
PrevNonEmpty returns the iterated segment's predecessor if it is adjacent, or the gap before the iterated segment otherwise. If seg.Start() == Functions.MinKey(), PrevNonEmpty will return two terminal iterators. Otherwise, exactly one of the iterators returned by PrevNonEmpty will be non-terminal.
func (DirtyIterator) PrevSegment ¶
func (seg DirtyIterator) PrevSegment() DirtyIterator
PrevSegment returns the iterated segment's predecessor. If there is no preceding segment, PrevSegment returns a terminal iterator.
func (DirtyIterator) Range ¶
func (seg DirtyIterator) Range() __generics_imported0.MappableRange
Range returns the iterated segment's range key.
func (DirtyIterator) SetEnd ¶
func (seg DirtyIterator) SetEnd(end uint64)
SetEnd mutates the iterated segment's end. If the new end value would cause the iterated segment to overlap another segment, or would result in an invalid range, SetEnd panics. This operation does not invalidate any iterators.
func (DirtyIterator) SetEndUnchecked ¶
func (seg DirtyIterator) SetEndUnchecked(end uint64)
SetEndUnchecked mutates the iterated segment's end. This operation does not invalidate any iterators.
Preconditions: The new end must be valid: * end > seg.Start(). * If seg.NextSegment().Ok(), then end <= seg.NextSegment().Start().
func (DirtyIterator) SetRange ¶
func (seg DirtyIterator) SetRange(r __generics_imported0.MappableRange)
SetRange mutates the iterated segment's range key. If the new range would cause the iterated segment to overlap another segment, or if the new range is invalid, SetRange panics. This operation does not invalidate any iterators.
func (DirtyIterator) SetRangeUnchecked ¶
func (seg DirtyIterator) SetRangeUnchecked(r __generics_imported0.MappableRange)
SetRangeUnchecked mutates the iterated segment's range key. This operation does not invalidate any iterators.
Preconditions: * r.Length() > 0. * The new range must not overlap an existing one:
- If seg.NextSegment().Ok(), then r.end <= seg.NextSegment().Start().
- If seg.PrevSegment().Ok(), then r.start >= seg.PrevSegment().End().
func (DirtyIterator) SetStart ¶
func (seg DirtyIterator) SetStart(start uint64)
SetStart mutates the iterated segment's start. If the new start value would cause the iterated segment to overlap another segment, or would result in an invalid range, SetStart panics. This operation does not invalidate any iterators.
func (DirtyIterator) SetStartUnchecked ¶
func (seg DirtyIterator) SetStartUnchecked(start uint64)
SetStartUnchecked mutates the iterated segment's start. This operation does not invalidate any iterators.
Preconditions: The new start must be valid: * start < seg.End() * If seg.PrevSegment().Ok(), then start >= seg.PrevSegment().End().
func (DirtyIterator) SetValue ¶
func (seg DirtyIterator) SetValue(val DirtyInfo)
SetValue mutates the iterated segment's value. This operation does not invalidate any iterators.
func (DirtyIterator) Start ¶
func (seg DirtyIterator) Start() uint64
Start is equivalent to Range().Start, but should be preferred if only the start of the range is needed.
func (DirtyIterator) Value ¶
func (seg DirtyIterator) Value() DirtyInfo
Value returns a copy of the iterated segment's value.
func (DirtyIterator) ValuePtr ¶
func (seg DirtyIterator) ValuePtr() *DirtyInfo
ValuePtr returns a pointer to the iterated segment's value. The pointer is invalidated if the iterator is invalidated. This operation does not invalidate any iterators.
type DirtySegmentDataSlices ¶
SegmentDataSlices represents segments from a set as slices of start, end, and values. SegmentDataSlices is primarily used as an intermediate representation for save/restore and the layout here is optimized for that.
+stateify savable
func (*DirtySegmentDataSlices) StateFields ¶
func (d *DirtySegmentDataSlices) StateFields() []string
func (*DirtySegmentDataSlices) StateLoad ¶
func (d *DirtySegmentDataSlices) StateLoad(stateSourceObject state.Source)
+checklocksignore
func (*DirtySegmentDataSlices) StateSave ¶
func (d *DirtySegmentDataSlices) StateSave(stateSinkObject state.Sink)
+checklocksignore
func (*DirtySegmentDataSlices) StateTypeName ¶
func (d *DirtySegmentDataSlices) StateTypeName() string
type DirtySet ¶
type DirtySet struct {
// contains filtered or unexported fields
}
A Set is a mapping of segments with non-overlapping Range keys. The zero value for a Set is an empty set. Set values are not safely movable nor copyable. Set is thread-compatible.
+stateify savable
func (*DirtySet) Add ¶
func (s *DirtySet) Add(r __generics_imported0.MappableRange, val DirtyInfo) bool
Add inserts the given segment into the set and returns true. If the new segment can be merged with adjacent segments, Add will do so. If the new segment would overlap an existing segment, Add returns false. If Add succeeds, all existing iterators are invalidated.
func (*DirtySet) AddWithoutMerging ¶
func (s *DirtySet) AddWithoutMerging(r __generics_imported0.MappableRange, val DirtyInfo) bool
AddWithoutMerging inserts the given segment into the set and returns true. If it would overlap an existing segment, AddWithoutMerging does nothing and returns false. If AddWithoutMerging succeeds, all existing iterators are invalidated.
func (*DirtySet) AllowClean ¶
func (ds *DirtySet) AllowClean(mr memmap.MappableRange)
AllowClean allows MarkClean to mark offsets in mr as not dirty, ending the effect of a previous call to KeepDirty. (It does not itself mark those offsets as not dirty.)
func (*DirtySet) ApplyContiguous ¶
func (s *DirtySet) ApplyContiguous(r __generics_imported0.MappableRange, fn func(seg DirtyIterator)) DirtyGapIterator
ApplyContiguous applies a function to a contiguous range of segments, splitting if necessary. The function is applied until the first gap is encountered, at which point the gap is returned. If the function is applied across the entire range, a terminal gap is returned. All existing iterators are invalidated.
N.B. The Iterator must not be invalidated by the function.
func (*DirtySet) ExportSortedSlices ¶
func (s *DirtySet) ExportSortedSlices() *DirtySegmentDataSlices
ExportSortedSlices returns a copy of all segments in the given set, in ascending key order.
func (*DirtySet) Find ¶
func (s *DirtySet) Find(key uint64) (DirtyIterator, DirtyGapIterator)
Find returns the segment or gap whose range contains the given key. If a segment is found, the returned Iterator is non-terminal and the returned GapIterator is terminal. Otherwise, the returned Iterator is terminal and the returned GapIterator is non-terminal.
func (*DirtySet) FindGap ¶
func (s *DirtySet) FindGap(key uint64) DirtyGapIterator
FindGap returns the gap containing the given key. If no such gap exists (i.e. the set contains a segment containing that key), FindGap returns a terminal iterator.
func (*DirtySet) FindSegment ¶
func (s *DirtySet) FindSegment(key uint64) DirtyIterator
FindSegment returns the segment whose range contains the given key. If no such segment exists, FindSegment returns a terminal iterator.
func (*DirtySet) FirstGap ¶
func (s *DirtySet) FirstGap() DirtyGapIterator
FirstGap returns the first gap in the set.
func (*DirtySet) FirstSegment ¶
func (s *DirtySet) FirstSegment() DirtyIterator
FirstSegment returns the first segment in the set. If the set is empty, FirstSegment returns a terminal iterator.
func (*DirtySet) ImportSortedSlices ¶
func (s *DirtySet) ImportSortedSlices(sds *DirtySegmentDataSlices) error
ImportSortedSlices initializes the given set from the given slice.
Preconditions:
- s must be empty.
- sds must represent a valid set (the segments in sds must have valid lengths that do not overlap).
- The segments in sds must be sorted in ascending key order.
func (*DirtySet) Insert ¶
func (s *DirtySet) Insert(gap DirtyGapIterator, r __generics_imported0.MappableRange, val DirtyInfo) DirtyIterator
Insert inserts the given segment into the given gap. If the new segment can be merged with adjacent segments, Insert will do so. Insert returns an iterator to the segment containing the inserted value (which may have been merged with other values). All existing iterators (including gap, but not including the returned iterator) are invalidated.
If the gap cannot accommodate the segment, or if r is invalid, Insert panics.
Insert is semantically equivalent to a InsertWithoutMerging followed by a Merge, but may be more efficient. Note that there is no unchecked variant of Insert since Insert must retrieve and inspect gap's predecessor and successor segments regardless.
func (*DirtySet) InsertWithoutMerging ¶
func (s *DirtySet) InsertWithoutMerging(gap DirtyGapIterator, r __generics_imported0.MappableRange, val DirtyInfo) DirtyIterator
InsertWithoutMerging inserts the given segment into the given gap and returns an iterator to the inserted segment. All existing iterators (including gap, but not including the returned iterator) are invalidated.
If the gap cannot accommodate the segment, or if r is invalid, InsertWithoutMerging panics.
func (*DirtySet) InsertWithoutMergingUnchecked ¶
func (s *DirtySet) InsertWithoutMergingUnchecked(gap DirtyGapIterator, r __generics_imported0.MappableRange, val DirtyInfo) DirtyIterator
InsertWithoutMergingUnchecked inserts the given segment into the given gap and returns an iterator to the inserted segment. All existing iterators (including gap, but not including the returned iterator) are invalidated.
Preconditions: * r.Start >= gap.Start(). * r.End <= gap.End().
func (*DirtySet) IsEmptyRange ¶
func (s *DirtySet) IsEmptyRange(r __generics_imported0.MappableRange) bool
IsEmptyRange returns true iff no segments in the set overlap the given range. This is semantically equivalent to s.SpanRange(r) == 0, but may be more efficient.
func (*DirtySet) Isolate ¶
func (s *DirtySet) Isolate(seg DirtyIterator, r __generics_imported0.MappableRange) DirtyIterator
Isolate ensures that the given segment's range does not escape r by splitting at r.Start and r.End if necessary, and returns an updated iterator to the bounded segment. All existing iterators (including seg, but not including the returned iterators) are invalidated.
func (*DirtySet) KeepClean ¶
func (ds *DirtySet) KeepClean(mr memmap.MappableRange)
KeepClean marks all offsets in mr as not dirty, even those that were previously kept dirty by KeepDirty.
func (*DirtySet) KeepDirty ¶
func (ds *DirtySet) KeepDirty(mr memmap.MappableRange)
KeepDirty marks all offsets in mr as dirty and prevents them from being marked as clean by MarkClean.
func (*DirtySet) LastGap ¶
func (s *DirtySet) LastGap() DirtyGapIterator
LastGap returns the last gap in the set.
func (*DirtySet) LastSegment ¶
func (s *DirtySet) LastSegment() DirtyIterator
LastSegment returns the last segment in the set. If the set is empty, LastSegment returns a terminal iterator.
func (*DirtySet) LowerBoundGap ¶
func (s *DirtySet) LowerBoundGap(min uint64) DirtyGapIterator
LowerBoundGap returns the gap with the lowest range that is greater than or equal to min.
func (*DirtySet) LowerBoundSegment ¶
func (s *DirtySet) LowerBoundSegment(min uint64) DirtyIterator
LowerBoundSegment returns the segment with the lowest range that contains a key greater than or equal to min. If no such segment exists, LowerBoundSegment returns a terminal iterator.
func (*DirtySet) MarkClean ¶
func (ds *DirtySet) MarkClean(mr memmap.MappableRange)
MarkClean marks all offsets in mr as not dirty, except for those to which KeepDirty has been applied.
func (*DirtySet) MarkDirty ¶
func (ds *DirtySet) MarkDirty(mr memmap.MappableRange)
MarkDirty marks all offsets in mr as dirty.
func (*DirtySet) Merge ¶
func (s *DirtySet) Merge(first, second DirtyIterator) DirtyIterator
Merge attempts to merge two neighboring segments. If successful, Merge returns an iterator to the merged segment, and all existing iterators are invalidated. Otherwise, Merge returns a terminal iterator.
If first is not the predecessor of second, Merge panics.
func (*DirtySet) MergeAdjacent ¶
func (s *DirtySet) MergeAdjacent(r __generics_imported0.MappableRange)
MergeAdjacent attempts to merge the segment containing r.Start with its predecessor, and the segment containing r.End-1 with its successor.
func (*DirtySet) MergeAll ¶
func (s *DirtySet) MergeAll()
MergeAll attempts to merge all adjacent segments in the set. All existing iterators are invalidated.
func (*DirtySet) MergeRange ¶
func (s *DirtySet) MergeRange(r __generics_imported0.MappableRange)
MergeRange attempts to merge all adjacent segments that contain a key in the specific range. All existing iterators are invalidated.
func (*DirtySet) MergeUnchecked ¶
func (s *DirtySet) MergeUnchecked(first, second DirtyIterator) DirtyIterator
MergeUnchecked attempts to merge two neighboring segments. If successful, MergeUnchecked returns an iterator to the merged segment, and all existing iterators are invalidated. Otherwise, MergeUnchecked returns a terminal iterator.
Precondition: first is the predecessor of second: first.NextSegment() == second, first == second.PrevSegment().
func (*DirtySet) Remove ¶
func (s *DirtySet) Remove(seg DirtyIterator) DirtyGapIterator
Remove removes the given segment and returns an iterator to the vacated gap. All existing iterators (including seg, but not including the returned iterator) are invalidated.
func (*DirtySet) RemoveAll ¶
func (s *DirtySet) RemoveAll()
RemoveAll removes all segments from the set. All existing iterators are invalidated.
func (*DirtySet) RemoveRange ¶
func (s *DirtySet) RemoveRange(r __generics_imported0.MappableRange) DirtyGapIterator
RemoveRange removes all segments in the given range. An iterator to the newly formed gap is returned, and all existing iterators are invalidated.
func (*DirtySet) SpanRange ¶
func (s *DirtySet) SpanRange(r __generics_imported0.MappableRange) uint64
SpanRange returns the total size of the intersection of segments in the set with the given range.
func (*DirtySet) Split ¶
func (s *DirtySet) Split(seg DirtyIterator, split uint64) (DirtyIterator, DirtyIterator)
Split splits the given segment at the given key and returns iterators to the two resulting segments. All existing iterators (including seg, but not including the returned iterators) are invalidated.
If the segment cannot be split at split (because split is at the start or end of the segment's range, so splitting would produce a segment with zero length, or because split falls outside the segment's range altogether), Split panics.
func (*DirtySet) SplitAt ¶
SplitAt splits the segment straddling split, if one exists. SplitAt returns true if a segment was split and false otherwise. If SplitAt splits a segment, all existing iterators are invalidated.
func (*DirtySet) SplitUnchecked ¶
func (s *DirtySet) SplitUnchecked(seg DirtyIterator, split uint64) (DirtyIterator, DirtyIterator)
SplitUnchecked splits the given segment at the given key and returns iterators to the two resulting segments. All existing iterators (including seg, but not including the returned iterators) are invalidated.
Preconditions: seg.Start() < key < seg.End().
func (*DirtySet) StateFields ¶
func (*DirtySet) StateTypeName ¶
func (*DirtySet) UpperBoundGap ¶
func (s *DirtySet) UpperBoundGap(max uint64) DirtyGapIterator
UpperBoundGap returns the gap with the highest range that is less than or equal to max.
func (*DirtySet) UpperBoundSegment ¶
func (s *DirtySet) UpperBoundSegment(max uint64) DirtyIterator
UpperBoundSegment returns the segment with the highest range that contains a key less than or equal to max. If no such segment exists, UpperBoundSegment returns a terminal iterator.
type DirtydynamicGap ¶
type DirtydynamicGap [DirtytrackGaps]uint64
dynamicGap is a type that disappears if trackGaps is 0.
func (*DirtydynamicGap) Get ¶
func (d *DirtydynamicGap) Get() uint64
Get returns the value of the gap.
Precondition: trackGaps must be non-zero.
func (*DirtydynamicGap) Set ¶
func (d *DirtydynamicGap) Set(v uint64)
Set sets the value of the gap.
Precondition: trackGaps must be non-zero.
type Dirtynode ¶
type Dirtynode struct {
// contains filtered or unexported fields
}
+stateify savable
func (*Dirtynode) StateFields ¶
func (*Dirtynode) StateTypeName ¶
type FileGenericSeek ¶
type FileGenericSeek struct{}
FileGenericSeek implements fs.FileOperations.Seek for files that use a generic seek implementation.
type FileNoFsync ¶
type FileNoFsync struct{}
FileNoFsync implements fs.FileOperations.Fsync for files that don't support syncing.
type FileNoIoctl ¶
type FileNoIoctl struct{}
FileNoIoctl implements fs.FileOperations.Ioctl for files that don't implement the ioctl syscall.
type FileNoMMap ¶
type FileNoMMap struct{}
FileNoMMap implements fs.FileOperations.Mappable for files that cannot be memory mapped.
func (FileNoMMap) ConfigureMMap ¶
ConfigureMMap implements fs.FileOperations.ConfigureMMap.
type FileNoRead ¶
type FileNoRead struct{}
FileNoRead implements fs.FileOperations.Read to return EINVAL.
type FileNoSeek ¶
type FileNoSeek struct{}
FileNoSeek implements fs.FileOperations.Seek to return EINVAL.
type FileNoSplice ¶
type FileNoSplice struct{}
FileNoSplice implements fs.FileOperations.ReadFrom and fs.FileOperations.WriteTo for files that don't support splice.
type FileNoWrite ¶
type FileNoWrite struct{}
FileNoWrite implements fs.FileOperations.Write to return EINVAL.
type FileNoopFlush ¶
type FileNoopFlush struct{}
FileNoopFlush implements fs.FileOperations.Flush as a no-op.
type FileNoopFsync ¶
type FileNoopFsync struct{}
FileNoopFsync implements fs.FileOperations.Fsync for files that don't need to synced.
type FileNoopRead ¶
type FileNoopRead struct{}
FileNoopRead implement fs.FileOperations.Read as a noop.
type FileNoopRelease ¶
type FileNoopRelease struct{}
FileNoopRelease implements fs.FileOperations.Release for files that have no resources to release.
func (FileNoopRelease) Release ¶
func (FileNoopRelease) Release(context.Context)
Release is a no-op.
type FileNoopWrite ¶
type FileNoopWrite struct{}
FileNoopWrite implements fs.FileOperations.Write as a noop.
type FileNotDirReaddir ¶
type FileNotDirReaddir struct{}
FileNotDirReaddir implements fs.FileOperations.Readdir for non-directories.
type FilePipeSeek ¶
type FilePipeSeek struct{}
FilePipeSeek implements fs.FileOperations.Seek and can be used for files that behave like pipes (seeking is not supported).
type FileRangeGapIterator ¶
type FileRangeGapIterator struct {
// contains filtered or unexported fields
}
A GapIterator is conceptually one of:
- A pointer to a position between two segments, before the first segment, or after the last segment in a set, called a *gap*; or
- A terminal iterator, which is a sentinel indicating that the end of iteration has been reached.
Note that the gap between two adjacent segments exists (iterators to it are non-terminal), but has a length of zero. GapIterator.IsEmpty returns true for such gaps. An empty set contains a single gap, spanning the entire range of the set's keys.
GapIterators are copyable values and are meaningfully equality-comparable. The zero value of GapIterator is a terminal iterator.
Unless otherwise specified, any mutation of a set invalidates all existing iterators into the set.
func (FileRangeGapIterator) End ¶
func (gap FileRangeGapIterator) End() uint64
End is equivalent to Range().End, but should be preferred if only the end of the range is needed.
func (FileRangeGapIterator) IsEmpty ¶
func (gap FileRangeGapIterator) IsEmpty() bool
IsEmpty returns true if the iterated gap is empty (that is, the "gap" is between two adjacent segments.)
func (FileRangeGapIterator) NextGap ¶
func (gap FileRangeGapIterator) NextGap() FileRangeGapIterator
NextGap returns the iterated gap's successor. If no such gap exists, NextGap returns a terminal iterator.
func (FileRangeGapIterator) NextLargeEnoughGap ¶
func (gap FileRangeGapIterator) NextLargeEnoughGap(minSize uint64) FileRangeGapIterator
NextLargeEnoughGap returns the iterated gap's first next gap with larger length than minSize. If not found, return a terminal gap iterator (does NOT include this gap itself).
Precondition: trackGaps must be 1.
func (FileRangeGapIterator) NextSegment ¶
func (gap FileRangeGapIterator) NextSegment() FileRangeIterator
NextSegment returns the segment immediately after the iterated gap. If no such segment exists, NextSegment returns a terminal iterator.
func (FileRangeGapIterator) Ok ¶
func (gap FileRangeGapIterator) Ok() bool
Ok returns true if the iterator is not terminal. All other methods are only valid for non-terminal iterators.
func (FileRangeGapIterator) PrevGap ¶
func (gap FileRangeGapIterator) PrevGap() FileRangeGapIterator
PrevGap returns the iterated gap's predecessor. If no such gap exists, PrevGap returns a terminal iterator.
func (FileRangeGapIterator) PrevLargeEnoughGap ¶
func (gap FileRangeGapIterator) PrevLargeEnoughGap(minSize uint64) FileRangeGapIterator
PrevLargeEnoughGap returns the iterated gap's first prev gap with larger or equal length than minSize. If not found, return a terminal gap iterator (does NOT include this gap itself).
Precondition: trackGaps must be 1.
func (FileRangeGapIterator) PrevSegment ¶
func (gap FileRangeGapIterator) PrevSegment() FileRangeIterator
PrevSegment returns the segment immediately before the iterated gap. If no such segment exists, PrevSegment returns a terminal iterator.
func (FileRangeGapIterator) Range ¶
func (gap FileRangeGapIterator) Range() __generics_imported0.MappableRange
Range returns the range spanned by the iterated gap.
func (FileRangeGapIterator) Start ¶
func (gap FileRangeGapIterator) Start() uint64
Start is equivalent to Range().Start, but should be preferred if only the start of the range is needed.
type FileRangeIterator ¶
type FileRangeIterator struct {
// contains filtered or unexported fields
}
A Iterator is conceptually one of:
- A pointer to a segment in a set; or
- A terminal iterator, which is a sentinel indicating that the end of iteration has been reached.
Iterators are copyable values and are meaningfully equality-comparable. The zero value of Iterator is a terminal iterator.
Unless otherwise specified, any mutation of a set invalidates all existing iterators into the set.
func FileRangesegmentAfterPosition ¶
func FileRangesegmentAfterPosition(n *FileRangenode, i int) FileRangeIterator
segmentAfterPosition returns the successor segment of the position given by n.children[i], which may or may not contain a child. If no such segment exists, segmentAfterPosition returns a terminal iterator.
func FileRangesegmentBeforePosition ¶
func FileRangesegmentBeforePosition(n *FileRangenode, i int) FileRangeIterator
segmentBeforePosition returns the predecessor segment of the position given by n.children[i], which may or may not contain a child. If no such segment exists, segmentBeforePosition returns a terminal iterator.
func (FileRangeIterator) End ¶
func (seg FileRangeIterator) End() uint64
End is equivalent to Range().End, but should be preferred if only the end of the range is needed.
func (FileRangeIterator) FileRange ¶
func (seg FileRangeIterator) FileRange() memmap.FileRange
FileRange returns the FileRange mapped by seg.
func (FileRangeIterator) FileRangeOf ¶
func (seg FileRangeIterator) FileRangeOf(mr memmap.MappableRange) memmap.FileRange
FileRangeOf returns the FileRange mapped by mr.
Preconditions: * seg.Range().IsSupersetOf(mr). * mr.Length() != 0.
func (FileRangeIterator) NextGap ¶
func (seg FileRangeIterator) NextGap() FileRangeGapIterator
NextGap returns the gap immediately after the iterated segment.
func (FileRangeIterator) NextNonEmpty ¶
func (seg FileRangeIterator) NextNonEmpty() (FileRangeIterator, FileRangeGapIterator)
NextNonEmpty returns the iterated segment's successor if it is adjacent, or the gap after the iterated segment otherwise. If seg.End() == Functions.MaxKey(), NextNonEmpty will return two terminal iterators. Otherwise, exactly one of the iterators returned by NextNonEmpty will be non-terminal.
func (FileRangeIterator) NextSegment ¶
func (seg FileRangeIterator) NextSegment() FileRangeIterator
NextSegment returns the iterated segment's successor. If there is no succeeding segment, NextSegment returns a terminal iterator.
func (FileRangeIterator) Ok ¶
func (seg FileRangeIterator) Ok() bool
Ok returns true if the iterator is not terminal. All other methods are only valid for non-terminal iterators.
func (FileRangeIterator) PrevGap ¶
func (seg FileRangeIterator) PrevGap() FileRangeGapIterator
PrevGap returns the gap immediately before the iterated segment.
func (FileRangeIterator) PrevNonEmpty ¶
func (seg FileRangeIterator) PrevNonEmpty() (FileRangeIterator, FileRangeGapIterator)
PrevNonEmpty returns the iterated segment's predecessor if it is adjacent, or the gap before the iterated segment otherwise. If seg.Start() == Functions.MinKey(), PrevNonEmpty will return two terminal iterators. Otherwise, exactly one of the iterators returned by PrevNonEmpty will be non-terminal.
func (FileRangeIterator) PrevSegment ¶
func (seg FileRangeIterator) PrevSegment() FileRangeIterator
PrevSegment returns the iterated segment's predecessor. If there is no preceding segment, PrevSegment returns a terminal iterator.
func (FileRangeIterator) Range ¶
func (seg FileRangeIterator) Range() __generics_imported0.MappableRange
Range returns the iterated segment's range key.
func (FileRangeIterator) SetEnd ¶
func (seg FileRangeIterator) SetEnd(end uint64)
SetEnd mutates the iterated segment's end. If the new end value would cause the iterated segment to overlap another segment, or would result in an invalid range, SetEnd panics. This operation does not invalidate any iterators.
func (FileRangeIterator) SetEndUnchecked ¶
func (seg FileRangeIterator) SetEndUnchecked(end uint64)
SetEndUnchecked mutates the iterated segment's end. This operation does not invalidate any iterators.
Preconditions: The new end must be valid: * end > seg.Start(). * If seg.NextSegment().Ok(), then end <= seg.NextSegment().Start().
func (FileRangeIterator) SetRange ¶
func (seg FileRangeIterator) SetRange(r __generics_imported0.MappableRange)
SetRange mutates the iterated segment's range key. If the new range would cause the iterated segment to overlap another segment, or if the new range is invalid, SetRange panics. This operation does not invalidate any iterators.
func (FileRangeIterator) SetRangeUnchecked ¶
func (seg FileRangeIterator) SetRangeUnchecked(r __generics_imported0.MappableRange)
SetRangeUnchecked mutates the iterated segment's range key. This operation does not invalidate any iterators.
Preconditions: * r.Length() > 0. * The new range must not overlap an existing one:
- If seg.NextSegment().Ok(), then r.end <= seg.NextSegment().Start().
- If seg.PrevSegment().Ok(), then r.start >= seg.PrevSegment().End().
func (FileRangeIterator) SetStart ¶
func (seg FileRangeIterator) SetStart(start uint64)
SetStart mutates the iterated segment's start. If the new start value would cause the iterated segment to overlap another segment, or would result in an invalid range, SetStart panics. This operation does not invalidate any iterators.
func (FileRangeIterator) SetStartUnchecked ¶
func (seg FileRangeIterator) SetStartUnchecked(start uint64)
SetStartUnchecked mutates the iterated segment's start. This operation does not invalidate any iterators.
Preconditions: The new start must be valid: * start < seg.End() * If seg.PrevSegment().Ok(), then start >= seg.PrevSegment().End().
func (FileRangeIterator) SetValue ¶
func (seg FileRangeIterator) SetValue(val uint64)
SetValue mutates the iterated segment's value. This operation does not invalidate any iterators.
func (FileRangeIterator) Start ¶
func (seg FileRangeIterator) Start() uint64
Start is equivalent to Range().Start, but should be preferred if only the start of the range is needed.
func (FileRangeIterator) Value ¶
func (seg FileRangeIterator) Value() uint64
Value returns a copy of the iterated segment's value.
func (FileRangeIterator) ValuePtr ¶
func (seg FileRangeIterator) ValuePtr() *uint64
ValuePtr returns a pointer to the iterated segment's value. The pointer is invalidated if the iterator is invalidated. This operation does not invalidate any iterators.
type FileRangeSegmentDataSlices ¶
SegmentDataSlices represents segments from a set as slices of start, end, and values. SegmentDataSlices is primarily used as an intermediate representation for save/restore and the layout here is optimized for that.
+stateify savable
func (*FileRangeSegmentDataSlices) StateFields ¶
func (f *FileRangeSegmentDataSlices) StateFields() []string
func (*FileRangeSegmentDataSlices) StateLoad ¶
func (f *FileRangeSegmentDataSlices) StateLoad(stateSourceObject state.Source)
+checklocksignore
func (*FileRangeSegmentDataSlices) StateSave ¶
func (f *FileRangeSegmentDataSlices) StateSave(stateSinkObject state.Sink)
+checklocksignore
func (*FileRangeSegmentDataSlices) StateTypeName ¶
func (f *FileRangeSegmentDataSlices) StateTypeName() string
type FileRangeSet ¶
type FileRangeSet struct {
// contains filtered or unexported fields
}
A Set is a mapping of segments with non-overlapping Range keys. The zero value for a Set is an empty set. Set values are not safely movable nor copyable. Set is thread-compatible.
+stateify savable
func (*FileRangeSet) Add ¶
func (s *FileRangeSet) Add(r __generics_imported0.MappableRange, val uint64) bool
Add inserts the given segment into the set and returns true. If the new segment can be merged with adjacent segments, Add will do so. If the new segment would overlap an existing segment, Add returns false. If Add succeeds, all existing iterators are invalidated.
func (*FileRangeSet) AddWithoutMerging ¶
func (s *FileRangeSet) AddWithoutMerging(r __generics_imported0.MappableRange, val uint64) bool
AddWithoutMerging inserts the given segment into the set and returns true. If it would overlap an existing segment, AddWithoutMerging does nothing and returns false. If AddWithoutMerging succeeds, all existing iterators are invalidated.
func (*FileRangeSet) ApplyContiguous ¶
func (s *FileRangeSet) ApplyContiguous(r __generics_imported0.MappableRange, fn func(seg FileRangeIterator)) FileRangeGapIterator
ApplyContiguous applies a function to a contiguous range of segments, splitting if necessary. The function is applied until the first gap is encountered, at which point the gap is returned. If the function is applied across the entire range, a terminal gap is returned. All existing iterators are invalidated.
N.B. The Iterator must not be invalidated by the function.
func (*FileRangeSet) Drop ¶
func (frs *FileRangeSet) Drop(mr memmap.MappableRange, mf *pgalloc.MemoryFile)
Drop removes segments for memmap.Mappable offsets in mr, freeing the corresponding memmap.FileRanges.
Preconditions: mr must be page-aligned.
func (*FileRangeSet) DropAll ¶
func (frs *FileRangeSet) DropAll(mf *pgalloc.MemoryFile)
DropAll removes all segments in mr, freeing the corresponding memmap.FileRanges.
func (*FileRangeSet) ExportSortedSlices ¶
func (s *FileRangeSet) ExportSortedSlices() *FileRangeSegmentDataSlices
ExportSortedSlices returns a copy of all segments in the given set, in ascending key order.
func (*FileRangeSet) Fill ¶
func (frs *FileRangeSet) Fill(ctx context.Context, required, optional memmap.MappableRange, fileSize uint64, mf *pgalloc.MemoryFile, kind usage.MemoryKind, readAt func(ctx context.Context, dsts safemem.BlockSeq, offset uint64) (uint64, error)) error
Fill attempts to ensure that all memmap.Mappable offsets in required are mapped to a memmap.File offset, by allocating from mf with the given memory usage kind and invoking readAt to store data into memory. (If readAt returns a successful partial read, Fill will call it repeatedly until all bytes have been read.) EOF is handled consistently with the requirements of mmap(2): bytes after EOF on the same page are zeroed; pages after EOF are invalid. fileSize is an upper bound on the file's size; bytes after fileSize will be zeroed without calling readAt.
Fill may read offsets outside of required, but will never read offsets outside of optional. It returns a non-nil error if any error occurs, even if the error only affects offsets in optional, but not in required.
Preconditions: * required.Length() > 0. * optional.IsSupersetOf(required). * required and optional must be page-aligned.
func (*FileRangeSet) Find ¶
func (s *FileRangeSet) Find(key uint64) (FileRangeIterator, FileRangeGapIterator)
Find returns the segment or gap whose range contains the given key. If a segment is found, the returned Iterator is non-terminal and the returned GapIterator is terminal. Otherwise, the returned Iterator is terminal and the returned GapIterator is non-terminal.
func (*FileRangeSet) FindGap ¶
func (s *FileRangeSet) FindGap(key uint64) FileRangeGapIterator
FindGap returns the gap containing the given key. If no such gap exists (i.e. the set contains a segment containing that key), FindGap returns a terminal iterator.
func (*FileRangeSet) FindSegment ¶
func (s *FileRangeSet) FindSegment(key uint64) FileRangeIterator
FindSegment returns the segment whose range contains the given key. If no such segment exists, FindSegment returns a terminal iterator.
func (*FileRangeSet) FirstGap ¶
func (s *FileRangeSet) FirstGap() FileRangeGapIterator
FirstGap returns the first gap in the set.
func (*FileRangeSet) FirstSegment ¶
func (s *FileRangeSet) FirstSegment() FileRangeIterator
FirstSegment returns the first segment in the set. If the set is empty, FirstSegment returns a terminal iterator.
func (*FileRangeSet) ImportSortedSlices ¶
func (s *FileRangeSet) ImportSortedSlices(sds *FileRangeSegmentDataSlices) error
ImportSortedSlices initializes the given set from the given slice.
Preconditions:
- s must be empty.
- sds must represent a valid set (the segments in sds must have valid lengths that do not overlap).
- The segments in sds must be sorted in ascending key order.
func (*FileRangeSet) Insert ¶
func (s *FileRangeSet) Insert(gap FileRangeGapIterator, r __generics_imported0.MappableRange, val uint64) FileRangeIterator
Insert inserts the given segment into the given gap. If the new segment can be merged with adjacent segments, Insert will do so. Insert returns an iterator to the segment containing the inserted value (which may have been merged with other values). All existing iterators (including gap, but not including the returned iterator) are invalidated.
If the gap cannot accommodate the segment, or if r is invalid, Insert panics.
Insert is semantically equivalent to a InsertWithoutMerging followed by a Merge, but may be more efficient. Note that there is no unchecked variant of Insert since Insert must retrieve and inspect gap's predecessor and successor segments regardless.
func (*FileRangeSet) InsertWithoutMerging ¶
func (s *FileRangeSet) InsertWithoutMerging(gap FileRangeGapIterator, r __generics_imported0.MappableRange, val uint64) FileRangeIterator
InsertWithoutMerging inserts the given segment into the given gap and returns an iterator to the inserted segment. All existing iterators (including gap, but not including the returned iterator) are invalidated.
If the gap cannot accommodate the segment, or if r is invalid, InsertWithoutMerging panics.
func (*FileRangeSet) InsertWithoutMergingUnchecked ¶
func (s *FileRangeSet) InsertWithoutMergingUnchecked(gap FileRangeGapIterator, r __generics_imported0.MappableRange, val uint64) FileRangeIterator
InsertWithoutMergingUnchecked inserts the given segment into the given gap and returns an iterator to the inserted segment. All existing iterators (including gap, but not including the returned iterator) are invalidated.
Preconditions: * r.Start >= gap.Start(). * r.End <= gap.End().
func (*FileRangeSet) IsEmpty ¶
func (s *FileRangeSet) IsEmpty() bool
IsEmpty returns true if the set contains no segments.
func (*FileRangeSet) IsEmptyRange ¶
func (s *FileRangeSet) IsEmptyRange(r __generics_imported0.MappableRange) bool
IsEmptyRange returns true iff no segments in the set overlap the given range. This is semantically equivalent to s.SpanRange(r) == 0, but may be more efficient.
func (*FileRangeSet) Isolate ¶
func (s *FileRangeSet) Isolate(seg FileRangeIterator, r __generics_imported0.MappableRange) FileRangeIterator
Isolate ensures that the given segment's range does not escape r by splitting at r.Start and r.End if necessary, and returns an updated iterator to the bounded segment. All existing iterators (including seg, but not including the returned iterators) are invalidated.
func (*FileRangeSet) LastGap ¶
func (s *FileRangeSet) LastGap() FileRangeGapIterator
LastGap returns the last gap in the set.
func (*FileRangeSet) LastSegment ¶
func (s *FileRangeSet) LastSegment() FileRangeIterator
LastSegment returns the last segment in the set. If the set is empty, LastSegment returns a terminal iterator.
func (*FileRangeSet) LowerBoundGap ¶
func (s *FileRangeSet) LowerBoundGap(min uint64) FileRangeGapIterator
LowerBoundGap returns the gap with the lowest range that is greater than or equal to min.
func (*FileRangeSet) LowerBoundSegment ¶
func (s *FileRangeSet) LowerBoundSegment(min uint64) FileRangeIterator
LowerBoundSegment returns the segment with the lowest range that contains a key greater than or equal to min. If no such segment exists, LowerBoundSegment returns a terminal iterator.
func (*FileRangeSet) Merge ¶
func (s *FileRangeSet) Merge(first, second FileRangeIterator) FileRangeIterator
Merge attempts to merge two neighboring segments. If successful, Merge returns an iterator to the merged segment, and all existing iterators are invalidated. Otherwise, Merge returns a terminal iterator.
If first is not the predecessor of second, Merge panics.
func (*FileRangeSet) MergeAdjacent ¶
func (s *FileRangeSet) MergeAdjacent(r __generics_imported0.MappableRange)
MergeAdjacent attempts to merge the segment containing r.Start with its predecessor, and the segment containing r.End-1 with its successor.
func (*FileRangeSet) MergeAll ¶
func (s *FileRangeSet) MergeAll()
MergeAll attempts to merge all adjacent segments in the set. All existing iterators are invalidated.
func (*FileRangeSet) MergeRange ¶
func (s *FileRangeSet) MergeRange(r __generics_imported0.MappableRange)
MergeRange attempts to merge all adjacent segments that contain a key in the specific range. All existing iterators are invalidated.
func (*FileRangeSet) MergeUnchecked ¶
func (s *FileRangeSet) MergeUnchecked(first, second FileRangeIterator) FileRangeIterator
MergeUnchecked attempts to merge two neighboring segments. If successful, MergeUnchecked returns an iterator to the merged segment, and all existing iterators are invalidated. Otherwise, MergeUnchecked returns a terminal iterator.
Precondition: first is the predecessor of second: first.NextSegment() == second, first == second.PrevSegment().
func (*FileRangeSet) Remove ¶
func (s *FileRangeSet) Remove(seg FileRangeIterator) FileRangeGapIterator
Remove removes the given segment and returns an iterator to the vacated gap. All existing iterators (including seg, but not including the returned iterator) are invalidated.
func (*FileRangeSet) RemoveAll ¶
func (s *FileRangeSet) RemoveAll()
RemoveAll removes all segments from the set. All existing iterators are invalidated.
func (*FileRangeSet) RemoveRange ¶
func (s *FileRangeSet) RemoveRange(r __generics_imported0.MappableRange) FileRangeGapIterator
RemoveRange removes all segments in the given range. An iterator to the newly formed gap is returned, and all existing iterators are invalidated.
func (*FileRangeSet) Span ¶
func (s *FileRangeSet) Span() uint64
Span returns the total size of all segments in the set.
func (*FileRangeSet) SpanRange ¶
func (s *FileRangeSet) SpanRange(r __generics_imported0.MappableRange) uint64
SpanRange returns the total size of the intersection of segments in the set with the given range.
func (*FileRangeSet) Split ¶
func (s *FileRangeSet) Split(seg FileRangeIterator, split uint64) (FileRangeIterator, FileRangeIterator)
Split splits the given segment at the given key and returns iterators to the two resulting segments. All existing iterators (including seg, but not including the returned iterators) are invalidated.
If the segment cannot be split at split (because split is at the start or end of the segment's range, so splitting would produce a segment with zero length, or because split falls outside the segment's range altogether), Split panics.
func (*FileRangeSet) SplitAt ¶
func (s *FileRangeSet) SplitAt(split uint64) bool
SplitAt splits the segment straddling split, if one exists. SplitAt returns true if a segment was split and false otherwise. If SplitAt splits a segment, all existing iterators are invalidated.
func (*FileRangeSet) SplitUnchecked ¶
func (s *FileRangeSet) SplitUnchecked(seg FileRangeIterator, split uint64) (FileRangeIterator, FileRangeIterator)
SplitUnchecked splits the given segment at the given key and returns iterators to the two resulting segments. All existing iterators (including seg, but not including the returned iterators) are invalidated.
Preconditions: seg.Start() < key < seg.End().
func (*FileRangeSet) StateFields ¶
func (s *FileRangeSet) StateFields() []string
func (*FileRangeSet) StateLoad ¶
func (s *FileRangeSet) StateLoad(stateSourceObject state.Source)
+checklocksignore
func (*FileRangeSet) StateSave ¶
func (s *FileRangeSet) StateSave(stateSinkObject state.Sink)
+checklocksignore
func (*FileRangeSet) StateTypeName ¶
func (s *FileRangeSet) StateTypeName() string
func (*FileRangeSet) String ¶
func (s *FileRangeSet) String() string
String stringifies a Set for debugging.
func (*FileRangeSet) Truncate ¶
func (frs *FileRangeSet) Truncate(end uint64, mf *pgalloc.MemoryFile)
Truncate updates frs to reflect Mappable truncation to the given length: bytes after the new EOF on the same page are zeroed, and pages after the new EOF are freed.
func (*FileRangeSet) UpperBoundGap ¶
func (s *FileRangeSet) UpperBoundGap(max uint64) FileRangeGapIterator
UpperBoundGap returns the gap with the highest range that is less than or equal to max.
func (*FileRangeSet) UpperBoundSegment ¶
func (s *FileRangeSet) UpperBoundSegment(max uint64) FileRangeIterator
UpperBoundSegment returns the segment with the highest range that contains a key less than or equal to max. If no such segment exists, UpperBoundSegment returns a terminal iterator.
type FileRangeSetFunctions ¶
type FileRangeSetFunctions struct{}
FileRangeSetFunctions implements segment.Functions for FileRangeSet.
func (FileRangeSetFunctions) ClearValue ¶
func (FileRangeSetFunctions) ClearValue(_ *uint64)
ClearValue implements segment.Functions.ClearValue.
func (FileRangeSetFunctions) MaxKey ¶
func (FileRangeSetFunctions) MaxKey() uint64
MaxKey implements segment.Functions.MaxKey.
func (FileRangeSetFunctions) Merge ¶
func (FileRangeSetFunctions) Merge(mr1 memmap.MappableRange, frstart1 uint64, _ memmap.MappableRange, frstart2 uint64) (uint64, bool)
Merge implements segment.Functions.Merge.
func (FileRangeSetFunctions) MinKey ¶
func (FileRangeSetFunctions) MinKey() uint64
MinKey implements segment.Functions.MinKey.
func (FileRangeSetFunctions) Split ¶
func (FileRangeSetFunctions) Split(mr memmap.MappableRange, frstart uint64, split uint64) (uint64, uint64)
Split implements segment.Functions.Split.
type FileRangedynamicGap ¶
type FileRangedynamicGap [FileRangetrackGaps]uint64
dynamicGap is a type that disappears if trackGaps is 0.
func (*FileRangedynamicGap) Get ¶
func (d *FileRangedynamicGap) Get() uint64
Get returns the value of the gap.
Precondition: trackGaps must be non-zero.
func (*FileRangedynamicGap) Set ¶
func (d *FileRangedynamicGap) Set(v uint64)
Set sets the value of the gap.
Precondition: trackGaps must be non-zero.
type FileRangenode ¶
type FileRangenode struct {
// contains filtered or unexported fields
}
+stateify savable
func (*FileRangenode) StateFields ¶
func (n *FileRangenode) StateFields() []string
func (*FileRangenode) StateLoad ¶
func (n *FileRangenode) StateLoad(stateSourceObject state.Source)
+checklocksignore
func (*FileRangenode) StateSave ¶
func (n *FileRangenode) StateSave(stateSinkObject state.Sink)
+checklocksignore
func (*FileRangenode) StateTypeName ¶
func (n *FileRangenode) StateTypeName() string
func (*FileRangenode) String ¶
func (n *FileRangenode) String() string
String stringifies a node (and all of its children) for debugging.
type FileStaticContentReader ¶
type FileStaticContentReader struct {
// contains filtered or unexported fields
}
FileStaticContentReader is a helper to implement fs.FileOperations.Read with static content.
+stateify savable
func NewFileStaticContentReader ¶
func NewFileStaticContentReader(b []byte) FileStaticContentReader
NewFileStaticContentReader initializes a FileStaticContentReader with the given content.
func (*FileStaticContentReader) Read ¶
func (scr *FileStaticContentReader) Read(ctx context.Context, _ *fs.File, dst usermem.IOSequence, offset int64) (int64, error)
Read implements fs.FileOperations.Read.
func (*FileStaticContentReader) StateFields ¶
func (scr *FileStaticContentReader) StateFields() []string
func (*FileStaticContentReader) StateLoad ¶
func (scr *FileStaticContentReader) StateLoad(stateSourceObject state.Source)
+checklocksignore
func (*FileStaticContentReader) StateSave ¶
func (scr *FileStaticContentReader) StateSave(stateSinkObject state.Sink)
+checklocksignore
func (*FileStaticContentReader) StateTypeName ¶
func (scr *FileStaticContentReader) StateTypeName() string
type FileUseInodeUnstableAttr ¶
type FileUseInodeUnstableAttr struct{}
FileUseInodeUnstableAttr implements fs.FileOperations.UnstableAttr by calling InodeOperations.UnstableAttr.
func (FileUseInodeUnstableAttr) UnstableAttr ¶
func (FileUseInodeUnstableAttr) UnstableAttr(ctx context.Context, file *fs.File) (fs.UnstableAttr, error)
UnstableAttr implements fs.FileOperations.UnstableAttr.
type FileZeroSeek ¶
type FileZeroSeek struct{}
FileZeroSeek implements fs.FileOperations.Seek for files that maintain a constant zero-value offset and require a no-op Seek.
type FrameRefGapIterator ¶
type FrameRefGapIterator struct {
// contains filtered or unexported fields
}
A GapIterator is conceptually one of:
- A pointer to a position between two segments, before the first segment, or after the last segment in a set, called a *gap*; or
- A terminal iterator, which is a sentinel indicating that the end of iteration has been reached.
Note that the gap between two adjacent segments exists (iterators to it are non-terminal), but has a length of zero. GapIterator.IsEmpty returns true for such gaps. An empty set contains a single gap, spanning the entire range of the set's keys.
GapIterators are copyable values and are meaningfully equality-comparable. The zero value of GapIterator is a terminal iterator.
Unless otherwise specified, any mutation of a set invalidates all existing iterators into the set.
func (FrameRefGapIterator) End ¶
func (gap FrameRefGapIterator) End() uint64
End is equivalent to Range().End, but should be preferred if only the end of the range is needed.
func (FrameRefGapIterator) IsEmpty ¶
func (gap FrameRefGapIterator) IsEmpty() bool
IsEmpty returns true if the iterated gap is empty (that is, the "gap" is between two adjacent segments.)
func (FrameRefGapIterator) NextGap ¶
func (gap FrameRefGapIterator) NextGap() FrameRefGapIterator
NextGap returns the iterated gap's successor. If no such gap exists, NextGap returns a terminal iterator.
func (FrameRefGapIterator) NextLargeEnoughGap ¶
func (gap FrameRefGapIterator) NextLargeEnoughGap(minSize uint64) FrameRefGapIterator
NextLargeEnoughGap returns the iterated gap's first next gap with larger length than minSize. If not found, return a terminal gap iterator (does NOT include this gap itself).
Precondition: trackGaps must be 1.
func (FrameRefGapIterator) NextSegment ¶
func (gap FrameRefGapIterator) NextSegment() FrameRefIterator
NextSegment returns the segment immediately after the iterated gap. If no such segment exists, NextSegment returns a terminal iterator.
func (FrameRefGapIterator) Ok ¶
func (gap FrameRefGapIterator) Ok() bool
Ok returns true if the iterator is not terminal. All other methods are only valid for non-terminal iterators.
func (FrameRefGapIterator) PrevGap ¶
func (gap FrameRefGapIterator) PrevGap() FrameRefGapIterator
PrevGap returns the iterated gap's predecessor. If no such gap exists, PrevGap returns a terminal iterator.
func (FrameRefGapIterator) PrevLargeEnoughGap ¶
func (gap FrameRefGapIterator) PrevLargeEnoughGap(minSize uint64) FrameRefGapIterator
PrevLargeEnoughGap returns the iterated gap's first prev gap with larger or equal length than minSize. If not found, return a terminal gap iterator (does NOT include this gap itself).
Precondition: trackGaps must be 1.
func (FrameRefGapIterator) PrevSegment ¶
func (gap FrameRefGapIterator) PrevSegment() FrameRefIterator
PrevSegment returns the segment immediately before the iterated gap. If no such segment exists, PrevSegment returns a terminal iterator.
func (FrameRefGapIterator) Range ¶
func (gap FrameRefGapIterator) Range() __generics_imported0.FileRange
Range returns the range spanned by the iterated gap.
func (FrameRefGapIterator) Start ¶
func (gap FrameRefGapIterator) Start() uint64
Start is equivalent to Range().Start, but should be preferred if only the start of the range is needed.
type FrameRefIterator ¶
type FrameRefIterator struct {
// contains filtered or unexported fields
}
A Iterator is conceptually one of:
- A pointer to a segment in a set; or
- A terminal iterator, which is a sentinel indicating that the end of iteration has been reached.
Iterators are copyable values and are meaningfully equality-comparable. The zero value of Iterator is a terminal iterator.
Unless otherwise specified, any mutation of a set invalidates all existing iterators into the set.
func FrameRefsegmentAfterPosition ¶
func FrameRefsegmentAfterPosition(n *FrameRefnode, i int) FrameRefIterator
segmentAfterPosition returns the successor segment of the position given by n.children[i], which may or may not contain a child. If no such segment exists, segmentAfterPosition returns a terminal iterator.
func FrameRefsegmentBeforePosition ¶
func FrameRefsegmentBeforePosition(n *FrameRefnode, i int) FrameRefIterator
segmentBeforePosition returns the predecessor segment of the position given by n.children[i], which may or may not contain a child. If no such segment exists, segmentBeforePosition returns a terminal iterator.
func (FrameRefIterator) End ¶
func (seg FrameRefIterator) End() uint64
End is equivalent to Range().End, but should be preferred if only the end of the range is needed.
func (FrameRefIterator) NextGap ¶
func (seg FrameRefIterator) NextGap() FrameRefGapIterator
NextGap returns the gap immediately after the iterated segment.
func (FrameRefIterator) NextNonEmpty ¶
func (seg FrameRefIterator) NextNonEmpty() (FrameRefIterator, FrameRefGapIterator)
NextNonEmpty returns the iterated segment's successor if it is adjacent, or the gap after the iterated segment otherwise. If seg.End() == Functions.MaxKey(), NextNonEmpty will return two terminal iterators. Otherwise, exactly one of the iterators returned by NextNonEmpty will be non-terminal.
func (FrameRefIterator) NextSegment ¶
func (seg FrameRefIterator) NextSegment() FrameRefIterator
NextSegment returns the iterated segment's successor. If there is no succeeding segment, NextSegment returns a terminal iterator.
func (FrameRefIterator) Ok ¶
func (seg FrameRefIterator) Ok() bool
Ok returns true if the iterator is not terminal. All other methods are only valid for non-terminal iterators.
func (FrameRefIterator) PrevGap ¶
func (seg FrameRefIterator) PrevGap() FrameRefGapIterator
PrevGap returns the gap immediately before the iterated segment.
func (FrameRefIterator) PrevNonEmpty ¶
func (seg FrameRefIterator) PrevNonEmpty() (FrameRefIterator, FrameRefGapIterator)
PrevNonEmpty returns the iterated segment's predecessor if it is adjacent, or the gap before the iterated segment otherwise. If seg.Start() == Functions.MinKey(), PrevNonEmpty will return two terminal iterators. Otherwise, exactly one of the iterators returned by PrevNonEmpty will be non-terminal.
func (FrameRefIterator) PrevSegment ¶
func (seg FrameRefIterator) PrevSegment() FrameRefIterator
PrevSegment returns the iterated segment's predecessor. If there is no preceding segment, PrevSegment returns a terminal iterator.
func (FrameRefIterator) Range ¶
func (seg FrameRefIterator) Range() __generics_imported0.FileRange
Range returns the iterated segment's range key.
func (FrameRefIterator) SetEnd ¶
func (seg FrameRefIterator) SetEnd(end uint64)
SetEnd mutates the iterated segment's end. If the new end value would cause the iterated segment to overlap another segment, or would result in an invalid range, SetEnd panics. This operation does not invalidate any iterators.
func (FrameRefIterator) SetEndUnchecked ¶
func (seg FrameRefIterator) SetEndUnchecked(end uint64)
SetEndUnchecked mutates the iterated segment's end. This operation does not invalidate any iterators.
Preconditions: The new end must be valid: * end > seg.Start(). * If seg.NextSegment().Ok(), then end <= seg.NextSegment().Start().
func (FrameRefIterator) SetRange ¶
func (seg FrameRefIterator) SetRange(r __generics_imported0.FileRange)
SetRange mutates the iterated segment's range key. If the new range would cause the iterated segment to overlap another segment, or if the new range is invalid, SetRange panics. This operation does not invalidate any iterators.
func (FrameRefIterator) SetRangeUnchecked ¶
func (seg FrameRefIterator) SetRangeUnchecked(r __generics_imported0.FileRange)
SetRangeUnchecked mutates the iterated segment's range key. This operation does not invalidate any iterators.
Preconditions: * r.Length() > 0. * The new range must not overlap an existing one:
- If seg.NextSegment().Ok(), then r.end <= seg.NextSegment().Start().
- If seg.PrevSegment().Ok(), then r.start >= seg.PrevSegment().End().
func (FrameRefIterator) SetStart ¶
func (seg FrameRefIterator) SetStart(start uint64)
SetStart mutates the iterated segment's start. If the new start value would cause the iterated segment to overlap another segment, or would result in an invalid range, SetStart panics. This operation does not invalidate any iterators.
func (FrameRefIterator) SetStartUnchecked ¶
func (seg FrameRefIterator) SetStartUnchecked(start uint64)
SetStartUnchecked mutates the iterated segment's start. This operation does not invalidate any iterators.
Preconditions: The new start must be valid: * start < seg.End() * If seg.PrevSegment().Ok(), then start >= seg.PrevSegment().End().
func (FrameRefIterator) SetValue ¶
func (seg FrameRefIterator) SetValue(val uint64)
SetValue mutates the iterated segment's value. This operation does not invalidate any iterators.
func (FrameRefIterator) Start ¶
func (seg FrameRefIterator) Start() uint64
Start is equivalent to Range().Start, but should be preferred if only the start of the range is needed.
func (FrameRefIterator) Value ¶
func (seg FrameRefIterator) Value() uint64
Value returns a copy of the iterated segment's value.
func (FrameRefIterator) ValuePtr ¶
func (seg FrameRefIterator) ValuePtr() *uint64
ValuePtr returns a pointer to the iterated segment's value. The pointer is invalidated if the iterator is invalidated. This operation does not invalidate any iterators.
type FrameRefSegmentDataSlices ¶
SegmentDataSlices represents segments from a set as slices of start, end, and values. SegmentDataSlices is primarily used as an intermediate representation for save/restore and the layout here is optimized for that.
+stateify savable
func (*FrameRefSegmentDataSlices) StateFields ¶
func (f *FrameRefSegmentDataSlices) StateFields() []string
func (*FrameRefSegmentDataSlices) StateLoad ¶
func (f *FrameRefSegmentDataSlices) StateLoad(stateSourceObject state.Source)
+checklocksignore
func (*FrameRefSegmentDataSlices) StateSave ¶
func (f *FrameRefSegmentDataSlices) StateSave(stateSinkObject state.Sink)
+checklocksignore
func (*FrameRefSegmentDataSlices) StateTypeName ¶
func (f *FrameRefSegmentDataSlices) StateTypeName() string
type FrameRefSet ¶
type FrameRefSet struct {
// contains filtered or unexported fields
}
A Set is a mapping of segments with non-overlapping Range keys. The zero value for a Set is an empty set. Set values are not safely movable nor copyable. Set is thread-compatible.
+stateify savable
func (*FrameRefSet) Add ¶
func (s *FrameRefSet) Add(r __generics_imported0.FileRange, val uint64) bool
Add inserts the given segment into the set and returns true. If the new segment can be merged with adjacent segments, Add will do so. If the new segment would overlap an existing segment, Add returns false. If Add succeeds, all existing iterators are invalidated.
func (*FrameRefSet) AddWithoutMerging ¶
func (s *FrameRefSet) AddWithoutMerging(r __generics_imported0.FileRange, val uint64) bool
AddWithoutMerging inserts the given segment into the set and returns true. If it would overlap an existing segment, AddWithoutMerging does nothing and returns false. If AddWithoutMerging succeeds, all existing iterators are invalidated.
func (*FrameRefSet) ApplyContiguous ¶
func (s *FrameRefSet) ApplyContiguous(r __generics_imported0.FileRange, fn func(seg FrameRefIterator)) FrameRefGapIterator
ApplyContiguous applies a function to a contiguous range of segments, splitting if necessary. The function is applied until the first gap is encountered, at which point the gap is returned. If the function is applied across the entire range, a terminal gap is returned. All existing iterators are invalidated.
N.B. The Iterator must not be invalidated by the function.
func (*FrameRefSet) DecRefAndAccount ¶
func (refs *FrameRefSet) DecRefAndAccount(fr memmap.FileRange)
DecRefAndAccount removes a reference on the range fr and untracks segments that are removed from memory accounting.
func (*FrameRefSet) ExportSortedSlices ¶
func (s *FrameRefSet) ExportSortedSlices() *FrameRefSegmentDataSlices
ExportSortedSlices returns a copy of all segments in the given set, in ascending key order.
func (*FrameRefSet) Find ¶
func (s *FrameRefSet) Find(key uint64) (FrameRefIterator, FrameRefGapIterator)
Find returns the segment or gap whose range contains the given key. If a segment is found, the returned Iterator is non-terminal and the returned GapIterator is terminal. Otherwise, the returned Iterator is terminal and the returned GapIterator is non-terminal.
func (*FrameRefSet) FindGap ¶
func (s *FrameRefSet) FindGap(key uint64) FrameRefGapIterator
FindGap returns the gap containing the given key. If no such gap exists (i.e. the set contains a segment containing that key), FindGap returns a terminal iterator.
func (*FrameRefSet) FindSegment ¶
func (s *FrameRefSet) FindSegment(key uint64) FrameRefIterator
FindSegment returns the segment whose range contains the given key. If no such segment exists, FindSegment returns a terminal iterator.
func (*FrameRefSet) FirstGap ¶
func (s *FrameRefSet) FirstGap() FrameRefGapIterator
FirstGap returns the first gap in the set.
func (*FrameRefSet) FirstSegment ¶
func (s *FrameRefSet) FirstSegment() FrameRefIterator
FirstSegment returns the first segment in the set. If the set is empty, FirstSegment returns a terminal iterator.
func (*FrameRefSet) ImportSortedSlices ¶
func (s *FrameRefSet) ImportSortedSlices(sds *FrameRefSegmentDataSlices) error
ImportSortedSlices initializes the given set from the given slice.
Preconditions:
- s must be empty.
- sds must represent a valid set (the segments in sds must have valid lengths that do not overlap).
- The segments in sds must be sorted in ascending key order.
func (*FrameRefSet) IncRefAndAccount ¶
func (refs *FrameRefSet) IncRefAndAccount(fr memmap.FileRange)
IncRefAndAccount adds a reference on the range fr. All newly inserted segments are accounted as host page cache memory mappings.
func (*FrameRefSet) Insert ¶
func (s *FrameRefSet) Insert(gap FrameRefGapIterator, r __generics_imported0.FileRange, val uint64) FrameRefIterator
Insert inserts the given segment into the given gap. If the new segment can be merged with adjacent segments, Insert will do so. Insert returns an iterator to the segment containing the inserted value (which may have been merged with other values). All existing iterators (including gap, but not including the returned iterator) are invalidated.
If the gap cannot accommodate the segment, or if r is invalid, Insert panics.
Insert is semantically equivalent to a InsertWithoutMerging followed by a Merge, but may be more efficient. Note that there is no unchecked variant of Insert since Insert must retrieve and inspect gap's predecessor and successor segments regardless.
func (*FrameRefSet) InsertWithoutMerging ¶
func (s *FrameRefSet) InsertWithoutMerging(gap FrameRefGapIterator, r __generics_imported0.FileRange, val uint64) FrameRefIterator
InsertWithoutMerging inserts the given segment into the given gap and returns an iterator to the inserted segment. All existing iterators (including gap, but not including the returned iterator) are invalidated.
If the gap cannot accommodate the segment, or if r is invalid, InsertWithoutMerging panics.
func (*FrameRefSet) InsertWithoutMergingUnchecked ¶
func (s *FrameRefSet) InsertWithoutMergingUnchecked(gap FrameRefGapIterator, r __generics_imported0.FileRange, val uint64) FrameRefIterator
InsertWithoutMergingUnchecked inserts the given segment into the given gap and returns an iterator to the inserted segment. All existing iterators (including gap, but not including the returned iterator) are invalidated.
Preconditions: * r.Start >= gap.Start(). * r.End <= gap.End().
func (*FrameRefSet) IsEmpty ¶
func (s *FrameRefSet) IsEmpty() bool
IsEmpty returns true if the set contains no segments.
func (*FrameRefSet) IsEmptyRange ¶
func (s *FrameRefSet) IsEmptyRange(r __generics_imported0.FileRange) bool
IsEmptyRange returns true iff no segments in the set overlap the given range. This is semantically equivalent to s.SpanRange(r) == 0, but may be more efficient.
func (*FrameRefSet) Isolate ¶
func (s *FrameRefSet) Isolate(seg FrameRefIterator, r __generics_imported0.FileRange) FrameRefIterator
Isolate ensures that the given segment's range does not escape r by splitting at r.Start and r.End if necessary, and returns an updated iterator to the bounded segment. All existing iterators (including seg, but not including the returned iterators) are invalidated.
func (*FrameRefSet) LastGap ¶
func (s *FrameRefSet) LastGap() FrameRefGapIterator
LastGap returns the last gap in the set.
func (*FrameRefSet) LastSegment ¶
func (s *FrameRefSet) LastSegment() FrameRefIterator
LastSegment returns the last segment in the set. If the set is empty, LastSegment returns a terminal iterator.
func (*FrameRefSet) LowerBoundGap ¶
func (s *FrameRefSet) LowerBoundGap(min uint64) FrameRefGapIterator
LowerBoundGap returns the gap with the lowest range that is greater than or equal to min.
func (*FrameRefSet) LowerBoundSegment ¶
func (s *FrameRefSet) LowerBoundSegment(min uint64) FrameRefIterator
LowerBoundSegment returns the segment with the lowest range that contains a key greater than or equal to min. If no such segment exists, LowerBoundSegment returns a terminal iterator.
func (*FrameRefSet) Merge ¶
func (s *FrameRefSet) Merge(first, second FrameRefIterator) FrameRefIterator
Merge attempts to merge two neighboring segments. If successful, Merge returns an iterator to the merged segment, and all existing iterators are invalidated. Otherwise, Merge returns a terminal iterator.
If first is not the predecessor of second, Merge panics.
func (*FrameRefSet) MergeAdjacent ¶
func (s *FrameRefSet) MergeAdjacent(r __generics_imported0.FileRange)
MergeAdjacent attempts to merge the segment containing r.Start with its predecessor, and the segment containing r.End-1 with its successor.
func (*FrameRefSet) MergeAll ¶
func (s *FrameRefSet) MergeAll()
MergeAll attempts to merge all adjacent segments in the set. All existing iterators are invalidated.
func (*FrameRefSet) MergeRange ¶
func (s *FrameRefSet) MergeRange(r __generics_imported0.FileRange)
MergeRange attempts to merge all adjacent segments that contain a key in the specific range. All existing iterators are invalidated.
func (*FrameRefSet) MergeUnchecked ¶
func (s *FrameRefSet) MergeUnchecked(first, second FrameRefIterator) FrameRefIterator
MergeUnchecked attempts to merge two neighboring segments. If successful, MergeUnchecked returns an iterator to the merged segment, and all existing iterators are invalidated. Otherwise, MergeUnchecked returns a terminal iterator.
Precondition: first is the predecessor of second: first.NextSegment() == second, first == second.PrevSegment().
func (*FrameRefSet) Remove ¶
func (s *FrameRefSet) Remove(seg FrameRefIterator) FrameRefGapIterator
Remove removes the given segment and returns an iterator to the vacated gap. All existing iterators (including seg, but not including the returned iterator) are invalidated.
func (*FrameRefSet) RemoveAll ¶
func (s *FrameRefSet) RemoveAll()
RemoveAll removes all segments from the set. All existing iterators are invalidated.
func (*FrameRefSet) RemoveRange ¶
func (s *FrameRefSet) RemoveRange(r __generics_imported0.FileRange) FrameRefGapIterator
RemoveRange removes all segments in the given range. An iterator to the newly formed gap is returned, and all existing iterators are invalidated.
func (*FrameRefSet) Span ¶
func (s *FrameRefSet) Span() uint64
Span returns the total size of all segments in the set.
func (*FrameRefSet) SpanRange ¶
func (s *FrameRefSet) SpanRange(r __generics_imported0.FileRange) uint64
SpanRange returns the total size of the intersection of segments in the set with the given range.
func (*FrameRefSet) Split ¶
func (s *FrameRefSet) Split(seg FrameRefIterator, split uint64) (FrameRefIterator, FrameRefIterator)
Split splits the given segment at the given key and returns iterators to the two resulting segments. All existing iterators (including seg, but not including the returned iterators) are invalidated.
If the segment cannot be split at split (because split is at the start or end of the segment's range, so splitting would produce a segment with zero length, or because split falls outside the segment's range altogether), Split panics.
func (*FrameRefSet) SplitAt ¶
func (s *FrameRefSet) SplitAt(split uint64) bool
SplitAt splits the segment straddling split, if one exists. SplitAt returns true if a segment was split and false otherwise. If SplitAt splits a segment, all existing iterators are invalidated.
func (*FrameRefSet) SplitUnchecked ¶
func (s *FrameRefSet) SplitUnchecked(seg FrameRefIterator, split uint64) (FrameRefIterator, FrameRefIterator)
SplitUnchecked splits the given segment at the given key and returns iterators to the two resulting segments. All existing iterators (including seg, but not including the returned iterators) are invalidated.
Preconditions: seg.Start() < key < seg.End().
func (*FrameRefSet) StateFields ¶
func (s *FrameRefSet) StateFields() []string
func (*FrameRefSet) StateLoad ¶
func (s *FrameRefSet) StateLoad(stateSourceObject state.Source)
+checklocksignore
func (*FrameRefSet) StateSave ¶
func (s *FrameRefSet) StateSave(stateSinkObject state.Sink)
+checklocksignore
func (*FrameRefSet) StateTypeName ¶
func (s *FrameRefSet) StateTypeName() string
func (*FrameRefSet) String ¶
func (s *FrameRefSet) String() string
String stringifies a Set for debugging.
func (*FrameRefSet) UpperBoundGap ¶
func (s *FrameRefSet) UpperBoundGap(max uint64) FrameRefGapIterator
UpperBoundGap returns the gap with the highest range that is less than or equal to max.
func (*FrameRefSet) UpperBoundSegment ¶
func (s *FrameRefSet) UpperBoundSegment(max uint64) FrameRefIterator
UpperBoundSegment returns the segment with the highest range that contains a key less than or equal to max. If no such segment exists, UpperBoundSegment returns a terminal iterator.
type FrameRefSetFunctions ¶
type FrameRefSetFunctions struct{}
FrameRefSetFunctions implements segment.Functions for FrameRefSet.
func (FrameRefSetFunctions) ClearValue ¶
func (FrameRefSetFunctions) ClearValue(val *uint64)
ClearValue implements segment.Functions.ClearValue.
func (FrameRefSetFunctions) MaxKey ¶
func (FrameRefSetFunctions) MaxKey() uint64
MaxKey implements segment.Functions.MaxKey.
func (FrameRefSetFunctions) Merge ¶
func (FrameRefSetFunctions) Merge(_ memmap.FileRange, val1 uint64, _ memmap.FileRange, val2 uint64) (uint64, bool)
Merge implements segment.Functions.Merge.
func (FrameRefSetFunctions) MinKey ¶
func (FrameRefSetFunctions) MinKey() uint64
MinKey implements segment.Functions.MinKey.
type FrameRefdynamicGap ¶
type FrameRefdynamicGap [FrameReftrackGaps]uint64
dynamicGap is a type that disappears if trackGaps is 0.
func (*FrameRefdynamicGap) Get ¶
func (d *FrameRefdynamicGap) Get() uint64
Get returns the value of the gap.
Precondition: trackGaps must be non-zero.
func (*FrameRefdynamicGap) Set ¶
func (d *FrameRefdynamicGap) Set(v uint64)
Set sets the value of the gap.
Precondition: trackGaps must be non-zero.
type FrameRefnode ¶
type FrameRefnode struct {
// contains filtered or unexported fields
}
+stateify savable
func (*FrameRefnode) StateFields ¶
func (n *FrameRefnode) StateFields() []string
func (*FrameRefnode) StateLoad ¶
func (n *FrameRefnode) StateLoad(stateSourceObject state.Source)
+checklocksignore
func (*FrameRefnode) StateSave ¶
func (n *FrameRefnode) StateSave(stateSinkObject state.Sink)
+checklocksignore
func (*FrameRefnode) StateTypeName ¶
func (n *FrameRefnode) StateTypeName() string
func (*FrameRefnode) String ¶
func (n *FrameRefnode) String() string
String stringifies a node (and all of its children) for debugging.
type HostFileMapper ¶
type HostFileMapper struct {
// contains filtered or unexported fields
}
HostFileMapper caches mappings of an arbitrary host file descriptor. It is used by implementations of memmap.Mappable that represent a host file descriptor.
+stateify savable
func NewHostFileMapper ¶
func NewHostFileMapper() *HostFileMapper
NewHostFileMapper returns an initialized HostFileMapper allocated on the heap with no references or cached mappings.
func (*HostFileMapper) DecRefOn ¶
func (f *HostFileMapper) DecRefOn(mr memmap.MappableRange)
DecRefOn decrements the reference count on all offsets in mr.
Preconditions: * mr.Length() != 0. * mr.Start and mr.End must be page-aligned.
func (*HostFileMapper) IncRefOn ¶
func (f *HostFileMapper) IncRefOn(mr memmap.MappableRange)
IncRefOn increments the reference count on all offsets in mr.
Preconditions: * mr.Length() != 0. * mr.Start and mr.End must be page-aligned.
func (*HostFileMapper) Init ¶
func (f *HostFileMapper) Init()
Init must be called on zero-value HostFileMappers before first use.
func (*HostFileMapper) IsInited ¶
func (f *HostFileMapper) IsInited() bool
IsInited returns true if f.Init() has been called. This is used when restoring a checkpoint that contains a HostFileMapper that may or may not have been initialized.
func (*HostFileMapper) MapInternal ¶
func (f *HostFileMapper) MapInternal(fr memmap.FileRange, fd int, write bool) (safemem.BlockSeq, error)
MapInternal returns a mapping of offsets in fr from fd. The returned safemem.BlockSeq is valid as long as at least one reference is held on all offsets in fr or until the next call to UnmapAll.
Preconditions: The caller must hold a reference on all offsets in fr.
func (*HostFileMapper) RegenerateMappings ¶
func (f *HostFileMapper) RegenerateMappings(fd int) error
RegenerateMappings must be called when the file description mapped by f changes, to replace existing mappings of the previous file description.
func (*HostFileMapper) StateFields ¶
func (f *HostFileMapper) StateFields() []string
func (*HostFileMapper) StateLoad ¶
func (f *HostFileMapper) StateLoad(stateSourceObject state.Source)
+checklocksignore
func (*HostFileMapper) StateSave ¶
func (f *HostFileMapper) StateSave(stateSinkObject state.Sink)
+checklocksignore
func (*HostFileMapper) StateTypeName ¶
func (f *HostFileMapper) StateTypeName() string
func (*HostFileMapper) UnmapAll ¶
func (f *HostFileMapper) UnmapAll()
UnmapAll unmaps all cached mappings. Callers are responsible for synchronization with mappings returned by previous calls to MapInternal.
type HostMappable ¶
type HostMappable struct {
// contains filtered or unexported fields
}
HostMappable implements memmap.Mappable and memmap.File over a CachedFileObject.
Lock order (compare the lock order model in mm/mm.go):
truncateMu ("fs locks") mu ("memmap.Mappable locks not taken by Translate") ("memmap.File locks") backingFile ("CachedFileObject locks")
+stateify savable
func NewHostMappable ¶
func NewHostMappable(backingFile CachedFileObject) *HostMappable
NewHostMappable creates a new mappable that maps directly to host FD.
func (*HostMappable) AddMapping ¶
func (h *HostMappable) AddMapping(ctx context.Context, ms memmap.MappingSpace, ar hostarch.AddrRange, offset uint64, writable bool) error
AddMapping implements memmap.Mappable.AddMapping.
func (*HostMappable) CopyMapping ¶
func (h *HostMappable) CopyMapping(ctx context.Context, ms memmap.MappingSpace, srcAR, dstAR hostarch.AddrRange, offset uint64, writable bool) error
CopyMapping implements memmap.Mappable.CopyMapping.
func (*HostMappable) DecRef ¶
func (h *HostMappable) DecRef(fr memmap.FileRange)
DecRef implements memmap.File.DecRef.
func (*HostMappable) IncRef ¶
func (h *HostMappable) IncRef(fr memmap.FileRange)
IncRef implements memmap.File.IncRef.
func (*HostMappable) InvalidateUnsavable ¶
func (h *HostMappable) InvalidateUnsavable(_ context.Context) error
InvalidateUnsavable implements memmap.Mappable.InvalidateUnsavable.
func (*HostMappable) MapInternal ¶
func (h *HostMappable) MapInternal(fr memmap.FileRange, at hostarch.AccessType) (safemem.BlockSeq, error)
MapInternal implements memmap.File.MapInternal.
func (*HostMappable) NotifyChangeFD ¶
func (h *HostMappable) NotifyChangeFD() error
NotifyChangeFD must be called after the file description represented by CachedFileObject.FD() changes.
func (*HostMappable) RemoveMapping ¶
func (h *HostMappable) RemoveMapping(ctx context.Context, ms memmap.MappingSpace, ar hostarch.AddrRange, offset uint64, writable bool)
RemoveMapping implements memmap.Mappable.RemoveMapping.
func (*HostMappable) StateFields ¶
func (h *HostMappable) StateFields() []string
func (*HostMappable) StateLoad ¶
func (h *HostMappable) StateLoad(stateSourceObject state.Source)
+checklocksignore
func (*HostMappable) StateSave ¶
func (h *HostMappable) StateSave(stateSinkObject state.Sink)
+checklocksignore
func (*HostMappable) StateTypeName ¶
func (h *HostMappable) StateTypeName() string
func (*HostMappable) Translate ¶
func (h *HostMappable) Translate(ctx context.Context, required, optional memmap.MappableRange, at hostarch.AccessType) ([]memmap.Translation, error)
Translate implements memmap.Mappable.Translate.
func (*HostMappable) Truncate ¶
func (h *HostMappable) Truncate(ctx context.Context, newSize int64) error
Truncate truncates the file, invalidating any mapping that may have been removed after the size change.
Truncation and writes are synchronized to prevent races where writes make the file grow between truncation and invalidation below:
T1: Calls SetMaskedAttributes and stalls T2: Appends to file causing it to grow T2: Writes to mapped pages and COW happens T1: Continues and wronly invalidates the page mapped in step above.
func (*HostMappable) Write ¶
func (h *HostMappable) Write(ctx context.Context, src usermem.IOSequence, offset int64) (int64, error)
Write writes to the file backing this mappable.
type InodeDenyWriteChecker ¶
type InodeDenyWriteChecker struct{}
InodeDenyWriteChecker implements fs.InodeOperations.Check which denies all write operations.
type InodeGenericChecker ¶
type InodeGenericChecker struct{}
InodeGenericChecker implements fs.InodeOperations.Check with a generic implementation.
type InodeIsDirAllocate ¶
type InodeIsDirAllocate struct{}
InodeIsDirAllocate implements fs.InodeOperations.Allocate for directories.
type InodeIsDirTruncate ¶
type InodeIsDirTruncate struct{}
InodeIsDirTruncate implements fs.InodeOperations.Truncate for directories.
type InodeNoExtendedAttributes ¶
type InodeNoExtendedAttributes struct{}
InodeNoExtendedAttributes can be used by Inodes that do not support extended attributes.
func (InodeNoExtendedAttributes) GetXattr ¶
func (InodeNoExtendedAttributes) GetXattr(context.Context, *fs.Inode, string, uint64) (string, error)
GetXattr implements fs.InodeOperations.GetXattr.
func (InodeNoExtendedAttributes) ListXattr ¶
func (InodeNoExtendedAttributes) ListXattr(context.Context, *fs.Inode, uint64) (map[string]struct{}, error)
ListXattr implements fs.InodeOperations.ListXattr.
func (InodeNoExtendedAttributes) RemoveXattr ¶
RemoveXattr implements fs.InodeOperations.RemoveXattr.
type InodeNoopAllocate ¶
type InodeNoopAllocate struct{}
InodeNoopAllocate implements fs.InodeOperations.Allocate as a noop.
type InodeNoopRelease ¶
type InodeNoopRelease struct{}
InodeNoopRelease implements fs.InodeOperations.Release as a noop.
func (InodeNoopRelease) Release ¶
func (InodeNoopRelease) Release(context.Context)
Release implements fs.InodeOperations.Release.
type InodeNoopTruncate ¶
type InodeNoopTruncate struct{}
InodeNoopTruncate implements fs.InodeOperations.Truncate as a noop.
type InodeNoopWriteOut ¶
type InodeNoopWriteOut struct{}
InodeNoopWriteOut is a no-op implementation of fs.InodeOperations.WriteOut.
type InodeNotAllocatable ¶
type InodeNotAllocatable struct{}
InodeNotAllocatable can be used by Inodes that do not support Allocate().
type InodeNotDirectory ¶
type InodeNotDirectory struct{}
InodeNotDirectory can be used by Inodes that are not directories.
func (InodeNotDirectory) Bind ¶
func (InodeNotDirectory) Bind(context.Context, *fs.Inode, string, transport.BoundEndpoint, fs.FilePermissions) (*fs.Dirent, error)
Bind implements fs.InodeOperations.Bind.
func (InodeNotDirectory) Create ¶
func (InodeNotDirectory) Create(context.Context, *fs.Inode, string, fs.FileFlags, fs.FilePermissions) (*fs.File, error)
Create implements fs.InodeOperations.Create.
func (InodeNotDirectory) CreateDirectory ¶
func (InodeNotDirectory) CreateDirectory(context.Context, *fs.Inode, string, fs.FilePermissions) error
CreateDirectory implements fs.InodeOperations.CreateDirectory.
func (InodeNotDirectory) CreateFifo ¶
func (InodeNotDirectory) CreateFifo(context.Context, *fs.Inode, string, fs.FilePermissions) error
CreateFifo implements fs.InodeOperations.CreateFifo.
func (InodeNotDirectory) CreateHardLink ¶
CreateHardLink implements fs.InodeOperations.CreateHardLink.
func (InodeNotDirectory) CreateLink ¶
CreateLink implements fs.InodeOperations.CreateLink.
func (InodeNotDirectory) RemoveDirectory ¶
RemoveDirectory implements fs.InodeOperations.RemoveDirectory.
type InodeNotMappable ¶
type InodeNotMappable struct{}
InodeNotMappable returns a nil memmap.Mappable.
type InodeNotOpenable ¶
type InodeNotOpenable struct{}
InodeNotOpenable can be used by Inodes that cannot be opened.
type InodeNotRenameable ¶
type InodeNotRenameable struct{}
InodeNotRenameable can be used by Inodes that cannot be truncated.
type InodeNotSocket ¶
type InodeNotSocket struct{}
InodeNotSocket can be used by Inodes that are not sockets.
func (InodeNotSocket) BoundEndpoint ¶
func (InodeNotSocket) BoundEndpoint(*fs.Inode, string) transport.BoundEndpoint
BoundEndpoint implements fs.InodeOperations.BoundEndpoint.
type InodeNotSymlink ¶
type InodeNotSymlink struct{}
InodeNotSymlink can be used by Inodes that are not symlinks.
type InodeNotTruncatable ¶
type InodeNotTruncatable struct{}
InodeNotTruncatable can be used by Inodes that cannot be truncated.
type InodeNotVirtual ¶
type InodeNotVirtual struct{}
InodeNotVirtual can be used by Inodes that are not virtual.
func (InodeNotVirtual) IsVirtual ¶
func (InodeNotVirtual) IsVirtual() bool
IsVirtual implements fs.InodeOperations.IsVirtual.
type InodeSimpleAttributes ¶
type InodeSimpleAttributes struct {
// contains filtered or unexported fields
}
InodeSimpleAttributes implements methods for updating in-memory unstable attributes.
+stateify savable
func NewInodeSimpleAttributes ¶
func NewInodeSimpleAttributes(ctx context.Context, owner fs.FileOwner, perms fs.FilePermissions, typ uint64) InodeSimpleAttributes
NewInodeSimpleAttributes returns a new InodeSimpleAttributes with the given owner and permissions, and all timestamps set to the current time.
func NewInodeSimpleAttributesWithUnstable ¶
func NewInodeSimpleAttributesWithUnstable(uattr fs.UnstableAttr, typ uint64) InodeSimpleAttributes
NewInodeSimpleAttributesWithUnstable returns a new InodeSimpleAttributes with the given unstable attributes.
func (*InodeSimpleAttributes) AddLink ¶
func (i *InodeSimpleAttributes) AddLink()
AddLink implements fs.InodeOperations.AddLink.
func (*InodeSimpleAttributes) DropLink ¶
func (i *InodeSimpleAttributes) DropLink()
DropLink implements fs.InodeOperations.DropLink.
func (*InodeSimpleAttributes) NotifyAccess ¶
func (i *InodeSimpleAttributes) NotifyAccess(ctx context.Context)
NotifyAccess updates the access time.
func (*InodeSimpleAttributes) NotifyModification ¶
func (i *InodeSimpleAttributes) NotifyModification(ctx context.Context)
NotifyModification updates the modification time.
func (*InodeSimpleAttributes) NotifyModificationAndStatusChange ¶
func (i *InodeSimpleAttributes) NotifyModificationAndStatusChange(ctx context.Context)
NotifyModificationAndStatusChange updates the modification and status change times.
func (*InodeSimpleAttributes) NotifyStatusChange ¶
func (i *InodeSimpleAttributes) NotifyStatusChange(ctx context.Context)
NotifyStatusChange updates the status change time.
func (*InodeSimpleAttributes) SetOwner ¶
func (i *InodeSimpleAttributes) SetOwner(ctx context.Context, _ *fs.Inode, owner fs.FileOwner) error
SetOwner implements fs.InodeOperations.SetOwner.
func (*InodeSimpleAttributes) SetPermissions ¶
func (i *InodeSimpleAttributes) SetPermissions(ctx context.Context, _ *fs.Inode, p fs.FilePermissions) bool
SetPermissions implements fs.InodeOperations.SetPermissions.
func (*InodeSimpleAttributes) SetTimestamps ¶
func (i *InodeSimpleAttributes) SetTimestamps(ctx context.Context, _ *fs.Inode, ts fs.TimeSpec) error
SetTimestamps implements fs.InodeOperations.SetTimestamps.
func (*InodeSimpleAttributes) StateFields ¶
func (i *InodeSimpleAttributes) StateFields() []string
func (*InodeSimpleAttributes) StateLoad ¶
func (i *InodeSimpleAttributes) StateLoad(stateSourceObject state.Source)
+checklocksignore
func (*InodeSimpleAttributes) StateSave ¶
func (i *InodeSimpleAttributes) StateSave(stateSinkObject state.Sink)
+checklocksignore
func (*InodeSimpleAttributes) StateTypeName ¶
func (i *InodeSimpleAttributes) StateTypeName() string
func (*InodeSimpleAttributes) UnstableAttr ¶
func (i *InodeSimpleAttributes) UnstableAttr(ctx context.Context, _ *fs.Inode) (fs.UnstableAttr, error)
UnstableAttr implements fs.InodeOperations.UnstableAttr.
type InodeSimpleExtendedAttributes ¶
type InodeSimpleExtendedAttributes struct {
// contains filtered or unexported fields
}
InodeSimpleExtendedAttributes implements fs.InodeOperations.{Get,Set,List}Xattr.
+stateify savable
func (*InodeSimpleExtendedAttributes) GetXattr ¶
func (i *InodeSimpleExtendedAttributes) GetXattr(_ context.Context, _ *fs.Inode, name string, _ uint64) (string, error)
GetXattr implements fs.InodeOperations.GetXattr.
func (*InodeSimpleExtendedAttributes) ListXattr ¶
func (i *InodeSimpleExtendedAttributes) ListXattr(context.Context, *fs.Inode, uint64) (map[string]struct{}, error)
ListXattr implements fs.InodeOperations.ListXattr.
func (*InodeSimpleExtendedAttributes) RemoveXattr ¶
func (i *InodeSimpleExtendedAttributes) RemoveXattr(_ context.Context, _ *fs.Inode, name string) error
RemoveXattr implements fs.InodeOperations.RemoveXattr.
func (*InodeSimpleExtendedAttributes) SetXattr ¶
func (i *InodeSimpleExtendedAttributes) SetXattr(_ context.Context, _ *fs.Inode, name, value string, flags uint32) error
SetXattr implements fs.InodeOperations.SetXattr.
func (*InodeSimpleExtendedAttributes) StateFields ¶
func (i *InodeSimpleExtendedAttributes) StateFields() []string
func (*InodeSimpleExtendedAttributes) StateLoad ¶
func (i *InodeSimpleExtendedAttributes) StateLoad(stateSourceObject state.Source)
+checklocksignore
func (*InodeSimpleExtendedAttributes) StateSave ¶
func (i *InodeSimpleExtendedAttributes) StateSave(stateSinkObject state.Sink)
+checklocksignore
func (*InodeSimpleExtendedAttributes) StateTypeName ¶
func (i *InodeSimpleExtendedAttributes) StateTypeName() string
type InodeStaticFileGetter ¶
type InodeStaticFileGetter struct {
Contents []byte
}
InodeStaticFileGetter implements GetFile for a file with static contents.
+stateify savable
func (*InodeStaticFileGetter) GetFile ¶
func (i *InodeStaticFileGetter) GetFile(ctx context.Context, dirent *fs.Dirent, flags fs.FileFlags) (*fs.File, error)
GetFile implements fs.InodeOperations.GetFile.
func (*InodeStaticFileGetter) StateFields ¶
func (i *InodeStaticFileGetter) StateFields() []string
func (*InodeStaticFileGetter) StateLoad ¶
func (i *InodeStaticFileGetter) StateLoad(stateSourceObject state.Source)
+checklocksignore
func (*InodeStaticFileGetter) StateSave ¶
func (i *InodeStaticFileGetter) StateSave(stateSinkObject state.Sink)
+checklocksignore
func (*InodeStaticFileGetter) StateTypeName ¶
func (i *InodeStaticFileGetter) StateTypeName() string
type InodeVirtual ¶
type InodeVirtual struct{}
InodeVirtual can be used by Inodes that are virtual.
func (InodeVirtual) IsVirtual ¶
func (InodeVirtual) IsVirtual() bool
IsVirtual implements fs.InodeOperations.IsVirtual.
type NoReadWriteFile ¶
type NoReadWriteFile struct { waiter.AlwaysReady `state:"nosave"` FileGenericSeek `state:"nosave"` FileNoIoctl `state:"nosave"` FileNoMMap `state:"nosave"` FileNoopFsync `state:"nosave"` FileNoopFlush `state:"nosave"` FileNoopRelease `state:"nosave"` FileNoRead `state:"nosave"` FileNoWrite `state:"nosave"` FileNotDirReaddir `state:"nosave"` FileUseInodeUnstableAttr `state:"nosave"` FileNoSplice `state:"nosave"` }
NoReadWriteFile is a file that does not support reading or writing.
+stateify savable
func (*NoReadWriteFile) StateFields ¶
func (n *NoReadWriteFile) StateFields() []string
func (*NoReadWriteFile) StateLoad ¶
func (n *NoReadWriteFile) StateLoad(stateSourceObject state.Source)
+checklocksignore
func (*NoReadWriteFile) StateSave ¶
func (n *NoReadWriteFile) StateSave(stateSinkObject state.Sink)
+checklocksignore
func (*NoReadWriteFile) StateTypeName ¶
func (n *NoReadWriteFile) StateTypeName() string
type NoReadWriteFileInode ¶
type NoReadWriteFileInode struct { InodeGenericChecker `state:"nosave"` InodeNoExtendedAttributes `state:"nosave"` InodeNoopRelease `state:"nosave"` InodeNoopWriteOut `state:"nosave"` InodeNotAllocatable `state:"nosave"` InodeNotDirectory `state:"nosave"` InodeNotMappable `state:"nosave"` InodeNotSocket `state:"nosave"` InodeNotSymlink `state:"nosave"` InodeNotTruncatable `state:"nosave"` InodeNotVirtual `state:"nosave"` InodeSimpleAttributes }
NoReadWriteFileInode is an implementation of InodeOperations that supports opening files that are not readable or writeable.
+stateify savable
func NewNoReadWriteFileInode ¶
func NewNoReadWriteFileInode(ctx context.Context, owner fs.FileOwner, perms fs.FilePermissions, typ uint64) *NoReadWriteFileInode
NewNoReadWriteFileInode returns a new NoReadWriteFileInode.
func (*NoReadWriteFileInode) GetFile ¶
func (*NoReadWriteFileInode) GetFile(ctx context.Context, dirent *fs.Dirent, flags fs.FileFlags) (*fs.File, error)
GetFile implements fs.InodeOperations.GetFile.
func (*NoReadWriteFileInode) StateFields ¶
func (n *NoReadWriteFileInode) StateFields() []string
func (*NoReadWriteFileInode) StateLoad ¶
func (n *NoReadWriteFileInode) StateLoad(stateSourceObject state.Source)
+checklocksignore
func (*NoReadWriteFileInode) StateSave ¶
func (n *NoReadWriteFileInode) StateSave(stateSinkObject state.Sink)
+checklocksignore
func (*NoReadWriteFileInode) StateTypeName ¶
func (n *NoReadWriteFileInode) StateTypeName() string
type SimpleFileInode ¶
type SimpleFileInode struct { InodeGenericChecker `state:"nosave"` InodeNoExtendedAttributes `state:"nosave"` InodeNoopRelease `state:"nosave"` InodeNoopWriteOut `state:"nosave"` InodeNotAllocatable `state:"nosave"` InodeNotDirectory `state:"nosave"` InodeNotMappable `state:"nosave"` InodeNotOpenable `state:"nosave"` InodeNotSocket `state:"nosave"` InodeNotSymlink `state:"nosave"` InodeNotTruncatable `state:"nosave"` InodeNotVirtual `state:"nosave"` InodeSimpleAttributes }
SimpleFileInode is a simple implementation of InodeOperations.
+stateify savable
func NewSimpleFileInode ¶
func NewSimpleFileInode(ctx context.Context, owner fs.FileOwner, perms fs.FilePermissions, typ uint64) *SimpleFileInode
NewSimpleFileInode returns a new SimpleFileInode.
func (*SimpleFileInode) StateFields ¶
func (s *SimpleFileInode) StateFields() []string
func (*SimpleFileInode) StateLoad ¶
func (s *SimpleFileInode) StateLoad(stateSourceObject state.Source)
+checklocksignore
func (*SimpleFileInode) StateSave ¶
func (s *SimpleFileInode) StateSave(stateSinkObject state.Sink)
+checklocksignore
func (*SimpleFileInode) StateTypeName ¶
func (s *SimpleFileInode) StateTypeName() string
type StaticDirFileOperations ¶
type StaticDirFileOperations struct { DirFileOperations `state:"nosave"` FileUseInodeUnstableAttr `state:"nosave"` // contains filtered or unexported fields }
StaticDirFileOperations implements fs.FileOperations for directories with static children.
+stateify savable
func NewStaticDirFileOperations ¶
func NewStaticDirFileOperations(dentries *fs.SortedDentryMap) *StaticDirFileOperations
NewStaticDirFileOperations returns a new StaticDirFileOperations that will iterate the given denty map.
func (*StaticDirFileOperations) IterateDir ¶
func (sdfo *StaticDirFileOperations) IterateDir(ctx context.Context, d *fs.Dirent, dirCtx *fs.DirCtx, offset int) (int, error)
IterateDir implements DirIterator.IterateDir.
func (*StaticDirFileOperations) Readdir ¶
func (sdfo *StaticDirFileOperations) Readdir(ctx context.Context, file *fs.File, serializer fs.DentrySerializer) (int64, error)
Readdir implements fs.FileOperations.Readdir.
func (*StaticDirFileOperations) StateFields ¶
func (sdfo *StaticDirFileOperations) StateFields() []string
func (*StaticDirFileOperations) StateLoad ¶
func (sdfo *StaticDirFileOperations) StateLoad(stateSourceObject state.Source)
+checklocksignore
func (*StaticDirFileOperations) StateSave ¶
func (sdfo *StaticDirFileOperations) StateSave(stateSinkObject state.Sink)
+checklocksignore
func (*StaticDirFileOperations) StateTypeName ¶
func (sdfo *StaticDirFileOperations) StateTypeName() string
Source Files ¶
- dirty_set.go
- dirty_set_impl.go
- file.go
- file_range_set.go
- file_range_set_impl.go
- frame_ref_set.go
- frame_ref_set_impl.go
- fsutil.go
- fsutil_impl_state_autogen.go
- fsutil_state_autogen.go
- fsutil_unsafe_state_autogen.go
- host_file_mapper.go
- host_file_mapper_state.go
- host_file_mapper_unsafe.go
- host_mappable.go
- inode.go
- inode_cached.go