Documentation ¶
Overview ¶
Package fsbridge provides common interfaces to bridge between VFS1 and VFS2 files.
Index ¶
- type File
- type Lookup
- type VFSFile
- func (f *VFSFile) ConfigureMMap(ctx context.Context, opts *memmap.MMapOpts) error
- func (f *VFSFile) DecRef(ctx context.Context)
- func (f *VFSFile) FileDescription() *vfs.FileDescription
- func (f *VFSFile) IncRef()
- func (f *VFSFile) PathnameWithDeleted(ctx context.Context) string
- func (f *VFSFile) ReadFull(ctx context.Context, dst usermem.IOSequence, offset int64) (int64, error)
- func (f *VFSFile) StateFields() []string
- func (f *VFSFile) StateLoad(stateSourceObject state.Source)
- func (f *VFSFile) StateSave(stateSinkObject state.Sink)
- func (f *VFSFile) StateTypeName() string
- func (f *VFSFile) Type(ctx context.Context) (linux.FileMode, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File interface { // PathnameWithDeleted returns an absolute pathname to vd, consistent with // Linux's d_path(). In particular, if vd.Dentry() has been disowned, // PathnameWithDeleted appends " (deleted)" to the returned pathname. PathnameWithDeleted(ctx context.Context) string // ReadFull read all contents from the file. ReadFull(ctx context.Context, dst usermem.IOSequence, offset int64) (int64, error) // ConfigureMMap mutates opts to implement mmap(2) for the file. ConfigureMMap(context.Context, *memmap.MMapOpts) error // Type returns the file type, e.g. linux.S_IFREG. Type(context.Context) (linux.FileMode, error) // IncRef increments reference. IncRef() // DecRef decrements reference. DecRef(ctx context.Context) }
File provides a common interface to bridge between VFS1 and VFS2 files.
func NewVFSFile ¶
func NewVFSFile(file *vfs.FileDescription) File
NewVFSFile creates a new File over fs.File.
type Lookup ¶
type Lookup interface { // OpenPath opens a file. OpenPath(ctx context.Context, path string, opts vfs.OpenOptions, remainingTraversals *uint, resolveFinal bool) (File, error) }
Lookup provides a common interface to open files.
func NewFSLookup ¶
func NewFSLookup(mntns *fs.MountNamespace, root, workingDir *fs.Dirent) Lookup
NewFSLookup creates a new Lookup using VFS1.
func NewVFSLookup ¶
func NewVFSLookup(mntns *vfs.MountNamespace, root, workingDir vfs.VirtualDentry) Lookup
NewVFSLookup creates a new Lookup using VFS2.
type VFSFile ¶
type VFSFile struct {
// contains filtered or unexported fields
}
VFSFile implements File interface over vfs.FileDescription.
+stateify savable
func (*VFSFile) ConfigureMMap ¶
ConfigureMMap implements File.
func (*VFSFile) FileDescription ¶
func (f *VFSFile) FileDescription() *vfs.FileDescription
FileDescription returns the FileDescription represented by f. It does not take an additional reference on the returned FileDescription.
func (*VFSFile) PathnameWithDeleted ¶
PathnameWithDeleted implements File.
func (*VFSFile) ReadFull ¶
func (f *VFSFile) ReadFull(ctx context.Context, dst usermem.IOSequence, offset int64) (int64, error)
ReadFull implements File.