Documentation ¶
Index ¶
- Constants
- func CheckSuccess(e error)
- func GetXAttr(path string, attr string, dest []byte) (value []byte, errno int)
- func Linkat(fd1 int, n1 string, fd2 int, n2 string) int
- func ListXAttr(path string) (attributes []string, errno int)
- func ModeToType(mode uint32) uint32
- func MountNodeFileSystem(mountpoint string, nodeFs NodeFileSystem, opts *FileSystemOptions) (*MountState, *FileSystemConnector, error)
- func Removexattr(path string, attr string) (errno int)
- func ReverseJoin(rev_components []string, sep string) string
- func Setxattr(path string, attr string, data []byte, flags int) (errno int)
- func ToStatT(f os.FileInfo) *syscall.Stat_t
- func VerboseTest() bool
- func Version() string
- func Writev(fd int, packet [][]byte) (n int, err error)
- type AccessIn
- type Attr
- func (a *Attr) AccessTime() time.Time
- func (a *Attr) Atimens() int64
- func (a *Attr) ChangeTime() time.Time
- func (a *Attr) Ctimens() int64
- func (a *Attr) FromStat(s *syscall.Stat_t)
- func (me *Attr) IsBlock() bool
- func (me *Attr) IsChar() bool
- func (me *Attr) IsDir() bool
- func (me *Attr) IsFifo() bool
- func (me *Attr) IsRegular() bool
- func (me *Attr) IsSocket() bool
- func (me *Attr) IsSymlink() bool
- func (a *Attr) ModTime() time.Time
- func (a *Attr) Mtimens() int64
- func (a *Attr) SetNs(atimens int64, mtimens int64, ctimens int64)
- func (a *Attr) SetTimes(access *time.Time, mod *time.Time, chstatus *time.Time)
- func (me *Attr) String() string
- type AttrOut
- type BmapIn
- type BmapOut
- type BufferPool
- type BufferPoolImpl
- type Context
- type CreateIn
- type CreateOut
- type CuseInitIn
- type CuseInitOut
- type DataFile
- type DefaultFile
- func (me *DefaultFile) Chmod(perms uint32) Status
- func (me *DefaultFile) Chown(uid uint32, gid uint32) Status
- func (me *DefaultFile) Flush() Status
- func (me *DefaultFile) Fsync(*FsyncIn) (code Status)
- func (me *DefaultFile) GetAttr() (*Attr, Status)
- func (me *DefaultFile) InnerFile() File
- func (me *DefaultFile) Ioctl(input *IoctlIn) (output *IoctlOut, data []byte, code Status)
- func (me *DefaultFile) Read(*ReadIn, BufferPool) ([]byte, Status)
- func (me *DefaultFile) Release()
- func (me *DefaultFile) SetInode(*Inode)
- func (me *DefaultFile) String() string
- func (me *DefaultFile) Truncate(size uint64) Status
- func (me *DefaultFile) Utimens(atimeNs int64, mtimeNs int64) Status
- func (me *DefaultFile) Write(*WriteIn, []byte) (uint32, Status)
- type DefaultFileSystem
- func (me *DefaultFileSystem) Access(name string, mode uint32, context *Context) (code Status)
- func (me *DefaultFileSystem) Chmod(name string, mode uint32, context *Context) (code Status)
- func (me *DefaultFileSystem) Chown(name string, uid uint32, gid uint32, context *Context) (code Status)
- func (me *DefaultFileSystem) Create(name string, flags uint32, mode uint32, context *Context) (file File, code Status)
- func (me *DefaultFileSystem) GetAttr(name string, context *Context) (*Attr, Status)
- func (me *DefaultFileSystem) GetXAttr(name string, attr string, context *Context) ([]byte, Status)
- func (me *DefaultFileSystem) Link(oldName string, newName string, context *Context) (code Status)
- func (me *DefaultFileSystem) ListXAttr(name string, context *Context) ([]string, Status)
- func (me *DefaultFileSystem) Mkdir(name string, mode uint32, context *Context) Status
- func (me *DefaultFileSystem) Mknod(name string, mode uint32, dev uint32, context *Context) Status
- func (me *DefaultFileSystem) OnMount(nodeFs *PathNodeFs)
- func (me *DefaultFileSystem) OnUnmount()
- func (me *DefaultFileSystem) Open(name string, flags uint32, context *Context) (file File, code Status)
- func (me *DefaultFileSystem) OpenDir(name string, context *Context) (stream chan DirEntry, status Status)
- func (me *DefaultFileSystem) Readlink(name string, context *Context) (string, Status)
- func (me *DefaultFileSystem) RemoveXAttr(name string, attr string, context *Context) Status
- func (me *DefaultFileSystem) Rename(oldName string, newName string, context *Context) (code Status)
- func (me *DefaultFileSystem) Rmdir(name string, context *Context) (code Status)
- func (me *DefaultFileSystem) SetXAttr(name string, attr string, data []byte, flags int, context *Context) Status
- func (me *DefaultFileSystem) StatFs(name string) *StatfsOut
- func (me *DefaultFileSystem) String() string
- func (me *DefaultFileSystem) Symlink(value string, linkName string, context *Context) (code Status)
- func (me *DefaultFileSystem) Truncate(name string, offset uint64, context *Context) (code Status)
- func (me *DefaultFileSystem) Unlink(name string, context *Context) (code Status)
- func (me *DefaultFileSystem) Utimens(name string, AtimeNs int64, CtimeNs int64, context *Context) (code Status)
- type DefaultFsNode
- func (me *DefaultFsNode) Access(mode uint32, context *Context) (code Status)
- func (me *DefaultFsNode) Chmod(file File, perms uint32, context *Context) (code Status)
- func (me *DefaultFsNode) Chown(file File, uid uint32, gid uint32, context *Context) (code Status)
- func (me *DefaultFsNode) Create(name string, flags uint32, mode uint32, context *Context) (file File, fi *Attr, newNode FsNode, code Status)
- func (me *DefaultFsNode) Deletable() bool
- func (me *DefaultFsNode) Flush(file File, openFlags uint32, context *Context) (code Status)
- func (me *DefaultFsNode) GetAttr(file File, context *Context) (fi *Attr, code Status)
- func (me *DefaultFsNode) GetXAttr(attribute string, context *Context) (data []byte, code Status)
- func (me *DefaultFsNode) Inode() *Inode
- func (me *DefaultFsNode) Link(name string, existing FsNode, context *Context) (fi *Attr, newNode FsNode, code Status)
- func (me *DefaultFsNode) ListXAttr(context *Context) (attrs []string, code Status)
- func (me *DefaultFsNode) Lookup(name string, context *Context) (fi *Attr, node FsNode, code Status)
- func (me *DefaultFsNode) Mkdir(name string, mode uint32, context *Context) (fi *Attr, newNode FsNode, code Status)
- func (me *DefaultFsNode) Mknod(name string, mode uint32, dev uint32, context *Context) (fi *Attr, newNode FsNode, code Status)
- func (me *DefaultFsNode) OnForget()
- func (me *DefaultFsNode) Open(flags uint32, context *Context) (file File, code Status)
- func (me *DefaultFsNode) OpenDir(context *Context) (chan DirEntry, Status)
- func (me *DefaultFsNode) Readlink(c *Context) ([]byte, Status)
- func (me *DefaultFsNode) RemoveXAttr(attr string, context *Context) Status
- func (me *DefaultFsNode) Rename(oldName string, newParent FsNode, newName string, context *Context) (code Status)
- func (me *DefaultFsNode) Rmdir(name string, context *Context) (code Status)
- func (me *DefaultFsNode) SetInode(node *Inode)
- func (me *DefaultFsNode) SetXAttr(attr string, data []byte, flags int, context *Context) Status
- func (me *DefaultFsNode) StatFs() *StatfsOut
- func (me *DefaultFsNode) Symlink(name string, content string, context *Context) (fi *Attr, newNode FsNode, code Status)
- func (me *DefaultFsNode) Truncate(file File, size uint64, context *Context) (code Status)
- func (me *DefaultFsNode) Unlink(name string, context *Context) (code Status)
- func (me *DefaultFsNode) Utimens(file File, atime int64, mtime int64, context *Context) (code Status)
- type DefaultNodeFileSystem
- type DefaultRawFileSystem
- func (me *DefaultRawFileSystem) Access(header *InHeader, input *AccessIn) (code Status)
- func (me *DefaultRawFileSystem) Bmap(header *InHeader, input *BmapIn) (out *BmapOut, code Status)
- func (me *DefaultRawFileSystem) Create(header *InHeader, input *CreateIn, name string) (flags uint32, handle uint64, out *EntryOut, code Status)
- func (me *DefaultRawFileSystem) Flush(header *InHeader, input *FlushIn) Status
- func (me *DefaultRawFileSystem) Forget(h *InHeader, input *ForgetIn)
- func (me *DefaultRawFileSystem) Fsync(header *InHeader, input *FsyncIn) (code Status)
- func (me *DefaultRawFileSystem) FsyncDir(header *InHeader, input *FsyncIn) (code Status)
- func (me *DefaultRawFileSystem) GetAttr(header *InHeader, input *GetAttrIn) (out *AttrOut, code Status)
- func (me *DefaultRawFileSystem) GetXAttrData(header *InHeader, attr string) (data []byte, code Status)
- func (me *DefaultRawFileSystem) GetXAttrSize(header *InHeader, attr string) (size int, code Status)
- func (me *DefaultRawFileSystem) Init(init *RawFsInit)
- func (me *DefaultRawFileSystem) Ioctl(header *InHeader, input *IoctlIn) (output *IoctlOut, data []byte, code Status)
- func (me *DefaultRawFileSystem) Link(header *InHeader, input *LinkIn, name string) (out *EntryOut, code Status)
- func (me *DefaultRawFileSystem) ListXAttr(header *InHeader) (data []byte, code Status)
- func (me *DefaultRawFileSystem) Lookup(h *InHeader, name string) (out *EntryOut, code Status)
- func (me *DefaultRawFileSystem) Mkdir(header *InHeader, input *MkdirIn, name string) (out *EntryOut, code Status)
- func (me *DefaultRawFileSystem) Mknod(header *InHeader, input *MknodIn, name string) (out *EntryOut, code Status)
- func (me *DefaultRawFileSystem) Open(header *InHeader, input *OpenIn) (flags uint32, handle uint64, status Status)
- func (me *DefaultRawFileSystem) OpenDir(header *InHeader, input *OpenIn) (flags uint32, handle uint64, status Status)
- func (me *DefaultRawFileSystem) Poll(header *InHeader, input *PollIn) (out *PollOut, code Status)
- func (me *DefaultRawFileSystem) Read(header *InHeader, input *ReadIn, bp BufferPool) ([]byte, Status)
- func (me *DefaultRawFileSystem) ReadDir(header *InHeader, input *ReadIn) (*DirEntryList, Status)
- func (me *DefaultRawFileSystem) Readlink(header *InHeader) (out []byte, code Status)
- func (me *DefaultRawFileSystem) Release(header *InHeader, input *ReleaseIn)
- func (me *DefaultRawFileSystem) ReleaseDir(header *InHeader, input *ReleaseIn)
- func (me *DefaultRawFileSystem) RemoveXAttr(header *InHeader, attr string) Status
- func (me *DefaultRawFileSystem) Rename(header *InHeader, input *RenameIn, oldName string, newName string) (code Status)
- func (me *DefaultRawFileSystem) Rmdir(header *InHeader, name string) (code Status)
- func (me *DefaultRawFileSystem) SetAttr(header *InHeader, input *SetAttrIn) (out *AttrOut, code Status)
- func (me *DefaultRawFileSystem) SetXAttr(header *InHeader, input *SetXAttrIn, attr string, data []byte) Status
- func (me *DefaultRawFileSystem) StatFs(h *InHeader) *StatfsOut
- func (me *DefaultRawFileSystem) Symlink(header *InHeader, pointedTo string, linkName string) (out *EntryOut, code Status)
- func (me *DefaultRawFileSystem) Unlink(header *InHeader, name string) (code Status)
- func (me *DefaultRawFileSystem) Write(header *InHeader, input *WriteIn, data []byte) (written uint32, code Status)
- type DevNullFile
- func (me *DevNullFile) Flush() Status
- func (me *DevNullFile) Fsync(*FsyncIn) (code Status)
- func (me *DevNullFile) Read(input *ReadIn, bp BufferPool) ([]byte, Status)
- func (me *DevNullFile) String() string
- func (me *DevNullFile) Truncate(size uint64) (code Status)
- func (me *DevNullFile) Write(input *WriteIn, content []byte) (uint32, Status)
- type DirEntry
- type DirEntryList
- type Dirent
- type EntryOut
- type File
- type FileLock
- type FileMode
- type FileSystem
- type FileSystemConnector
- func (me *FileSystemConnector) Access(header *InHeader, input *AccessIn) (code Status)
- func (me *FileSystemConnector) Create(header *InHeader, input *CreateIn, name string) (flags uint32, h uint64, out *EntryOut, code Status)
- func (me *FileSystemConnector) EntryNotify(dir *Inode, name string) Status
- func (me *FileSystemConnector) FileNotify(node *Inode, off int64, length int64) Status
- func (me *FileSystemConnector) Flush(header *InHeader, input *FlushIn) Status
- func (me *FileSystemConnector) Forget(h *InHeader, input *ForgetIn)
- func (me *FileSystemConnector) GetAttr(header *InHeader, input *GetAttrIn) (out *AttrOut, code Status)
- func (me *FileSystemConnector) GetXAttrData(header *InHeader, attribute string) (data []byte, code Status)
- func (me *FileSystemConnector) GetXAttrSize(header *InHeader, attribute string) (sz int, code Status)
- func (me *FileSystemConnector) Init(fsInit *RawFsInit)
- func (me *FileSystemConnector) Link(header *InHeader, input *LinkIn, name string) (out *EntryOut, code Status)
- func (me *FileSystemConnector) ListXAttr(header *InHeader) (data []byte, code Status)
- func (me *FileSystemConnector) Lookup(header *InHeader, name string) (out *EntryOut, code Status)
- func (me *FileSystemConnector) LookupNode(parent *Inode, path string) *Inode
- func (me *FileSystemConnector) Mkdir(header *InHeader, input *MkdirIn, name string) (out *EntryOut, code Status)
- func (me *FileSystemConnector) Mknod(header *InHeader, input *MknodIn, name string) (out *EntryOut, code Status)
- func (me *FileSystemConnector) Mount(parent *Inode, name string, nodeFs NodeFileSystem, opts *FileSystemOptions) Status
- func (me *FileSystemConnector) MountRoot(nodeFs NodeFileSystem, opts *FileSystemOptions)
- func (me *FileSystemConnector) Node(parent *Inode, fullPath string) (*Inode, []string)
- func (me *FileSystemConnector) Open(header *InHeader, input *OpenIn) (flags uint32, handle uint64, status Status)
- func (me *FileSystemConnector) OpenDir(header *InHeader, input *OpenIn) (flags uint32, handle uint64, code Status)
- func (me *FileSystemConnector) Read(header *InHeader, input *ReadIn, bp BufferPool) ([]byte, Status)
- func (me *FileSystemConnector) ReadDir(header *InHeader, input *ReadIn) (*DirEntryList, Status)
- func (me *FileSystemConnector) Readlink(header *InHeader) (out []byte, code Status)
- func (me *FileSystemConnector) Release(header *InHeader, input *ReleaseIn)
- func (me *FileSystemConnector) ReleaseDir(header *InHeader, input *ReleaseIn)
- func (me *FileSystemConnector) RemoveXAttr(header *InHeader, attr string) Status
- func (me *FileSystemConnector) Rename(header *InHeader, input *RenameIn, oldName string, newName string) (code Status)
- func (me *FileSystemConnector) Rmdir(header *InHeader, name string) (code Status)
- func (me *FileSystemConnector) SetAttr(header *InHeader, input *SetAttrIn) (out *AttrOut, code Status)
- func (me *FileSystemConnector) SetXAttr(header *InHeader, input *SetXAttrIn, attr string, data []byte) Status
- func (me *FileSystemConnector) StatFs(header *InHeader) *StatfsOut
- func (me *FileSystemConnector) Symlink(header *InHeader, pointedTo string, linkName string) (out *EntryOut, code Status)
- func (me *FileSystemConnector) Unlink(header *InHeader, name string) (code Status)
- func (me *FileSystemConnector) Unmount(node *Inode) Status
- func (me *FileSystemConnector) Write(header *InHeader, input *WriteIn, data []byte) (written uint32, code Status)
- type FileSystemOptions
- type FlushIn
- type ForgetIn
- type FsNode
- type FsyncIn
- type GcBufferPool
- type GetAttrIn
- type GetXAttrIn
- type GetXAttrOut
- type HandleMap
- type Handled
- type InHeader
- type InitIn
- type InitOut
- type Inode
- func (me *Inode) AddChild(name string, child *Inode)
- func (me *Inode) AnyFile() (file File)
- func (me *Inode) Children() (out map[string]*Inode)
- func (me *Inode) Files(mask uint32) (files []WithFlags)
- func (me *Inode) FsChildren() (out map[string]*Inode)
- func (me *Inode) FsNode() FsNode
- func (me *Inode) GetChild(name string) (child *Inode)
- func (me *Inode) IsDir() bool
- func (me *Inode) New(isDir bool, fsi FsNode) *Inode
- func (me *Inode) RmChild(name string) (ch *Inode)
- type InterruptIn
- type IoctlIn
- type IoctlOut
- type Kstatfs
- type LatencyArg
- type LatencyMap
- type LinkIn
- type LkIn
- type LkOut
- type LockingFileSystem
- func (me *LockingFileSystem) Access(name string, mode uint32, context *Context) (code Status)
- func (me *LockingFileSystem) Chmod(name string, mode uint32, context *Context) (code Status)
- func (me *LockingFileSystem) Chown(name string, uid uint32, gid uint32, context *Context) (code Status)
- func (me *LockingFileSystem) Create(name string, flags uint32, mode uint32, context *Context) (file File, code Status)
- func (me *LockingFileSystem) GetAttr(name string, context *Context) (*Attr, Status)
- func (me *LockingFileSystem) GetXAttr(name string, attr string, context *Context) ([]byte, Status)
- func (me *LockingFileSystem) Link(oldName string, newName string, context *Context) (code Status)
- func (me *LockingFileSystem) ListXAttr(name string, context *Context) ([]string, Status)
- func (me *LockingFileSystem) Mkdir(name string, mode uint32, context *Context) Status
- func (me *LockingFileSystem) Mknod(name string, mode uint32, dev uint32, context *Context) Status
- func (me *LockingFileSystem) OnMount(nodeFs *PathNodeFs)
- func (me *LockingFileSystem) OnUnmount()
- func (me *LockingFileSystem) Open(name string, flags uint32, context *Context) (file File, code Status)
- func (me *LockingFileSystem) OpenDir(name string, context *Context) (stream chan DirEntry, status Status)
- func (me *LockingFileSystem) Readlink(name string, context *Context) (string, Status)
- func (me *LockingFileSystem) RemoveXAttr(name string, attr string, context *Context) Status
- func (me *LockingFileSystem) Rename(oldName string, newName string, context *Context) (code Status)
- func (me *LockingFileSystem) Rmdir(name string, context *Context) (code Status)
- func (me *LockingFileSystem) SetXAttr(name string, attr string, data []byte, flags int, context *Context) Status
- func (me *LockingFileSystem) Symlink(value string, linkName string, context *Context) (code Status)
- func (me *LockingFileSystem) Truncate(name string, offset uint64, context *Context) (code Status)
- func (me *LockingFileSystem) Unlink(name string, context *Context) (code Status)
- func (me *LockingFileSystem) Utimens(name string, AtimeNs int64, CtimeNs int64, context *Context) (code Status)
- type LockingRawFileSystem
- func (me *LockingRawFileSystem) Access(header *InHeader, input *AccessIn) (code Status)
- func (me *LockingRawFileSystem) Create(header *InHeader, input *CreateIn, name string) (flags uint32, handle uint64, out *EntryOut, code Status)
- func (me *LockingRawFileSystem) Flush(header *InHeader, input *FlushIn) Status
- func (me *LockingRawFileSystem) Forget(h *InHeader, input *ForgetIn)
- func (me *LockingRawFileSystem) Fsync(header *InHeader, input *FsyncIn) (code Status)
- func (me *LockingRawFileSystem) FsyncDir(header *InHeader, input *FsyncIn) (code Status)
- func (me *LockingRawFileSystem) GetAttr(header *InHeader, input *GetAttrIn) (out *AttrOut, code Status)
- func (me *LockingRawFileSystem) GetXAttrData(header *InHeader, attr string) (data []byte, code Status)
- func (me *LockingRawFileSystem) GetXAttrSize(header *InHeader, attr string) (sz int, code Status)
- func (me *LockingRawFileSystem) Link(header *InHeader, input *LinkIn, name string) (out *EntryOut, code Status)
- func (me *LockingRawFileSystem) ListXAttr(header *InHeader) (data []byte, code Status)
- func (me *LockingRawFileSystem) Lookup(h *InHeader, name string) (out *EntryOut, code Status)
- func (me *LockingRawFileSystem) Mkdir(header *InHeader, input *MkdirIn, name string) (out *EntryOut, code Status)
- func (me *LockingRawFileSystem) Mknod(header *InHeader, input *MknodIn, name string) (out *EntryOut, code Status)
- func (me *LockingRawFileSystem) Open(header *InHeader, input *OpenIn) (flags uint32, handle uint64, status Status)
- func (me *LockingRawFileSystem) OpenDir(header *InHeader, input *OpenIn) (flags uint32, h uint64, status Status)
- func (me *LockingRawFileSystem) Read(header *InHeader, input *ReadIn, bp BufferPool) ([]byte, Status)
- func (me *LockingRawFileSystem) ReadDir(header *InHeader, input *ReadIn) (*DirEntryList, Status)
- func (me *LockingRawFileSystem) Readlink(header *InHeader) (out []byte, code Status)
- func (me *LockingRawFileSystem) Release(header *InHeader, input *ReleaseIn)
- func (me *LockingRawFileSystem) ReleaseDir(header *InHeader, h *ReleaseIn)
- func (me *LockingRawFileSystem) RemoveXAttr(header *InHeader, attr string) Status
- func (me *LockingRawFileSystem) Rename(header *InHeader, input *RenameIn, oldName string, newName string) (code Status)
- func (me *LockingRawFileSystem) Rmdir(header *InHeader, name string) (code Status)
- func (me *LockingRawFileSystem) SetAttr(header *InHeader, input *SetAttrIn) (out *AttrOut, code Status)
- func (me *LockingRawFileSystem) SetXAttr(header *InHeader, input *SetXAttrIn, attr string, data []byte) Status
- func (me *LockingRawFileSystem) Symlink(header *InHeader, pointedTo string, linkName string) (out *EntryOut, code Status)
- func (me *LockingRawFileSystem) Unlink(header *InHeader, name string) (code Status)
- func (me *LockingRawFileSystem) Write(header *InHeader, input *WriteIn, data []byte) (written uint32, code Status)
- type LoopbackFile
- func (me *LoopbackFile) Chmod(mode uint32) Status
- func (me *LoopbackFile) Chown(uid uint32, gid uint32) Status
- func (me *LoopbackFile) Fsync(*FsyncIn) (code Status)
- func (me *LoopbackFile) GetAttr() (*Attr, Status)
- func (me *LoopbackFile) Read(input *ReadIn, buffers BufferPool) ([]byte, Status)
- func (me *LoopbackFile) Release()
- func (me *LoopbackFile) String() string
- func (me *LoopbackFile) Truncate(size uint64) Status
- func (me *LoopbackFile) Write(input *WriteIn, data []byte) (uint32, Status)
- type LoopbackFileSystem
- func (me *LoopbackFileSystem) Access(name string, mode uint32, context *Context) (code Status)
- func (me *LoopbackFileSystem) Chmod(path string, mode uint32, context *Context) (code Status)
- func (me *LoopbackFileSystem) Chown(path string, uid uint32, gid uint32, context *Context) (code Status)
- func (me *LoopbackFileSystem) Create(path string, flags uint32, mode uint32, context *Context) (fuseFile File, code Status)
- func (me *LoopbackFileSystem) GetAttr(name string, context *Context) (a *Attr, code Status)
- func (me *LoopbackFileSystem) GetPath(relPath string) string
- func (me *LoopbackFileSystem) GetXAttr(name string, attr string, context *Context) ([]byte, Status)
- func (me *LoopbackFileSystem) Link(orig string, newName string, context *Context) (code Status)
- func (me *LoopbackFileSystem) ListXAttr(name string, context *Context) ([]string, Status)
- func (me *LoopbackFileSystem) Mkdir(path string, mode uint32, context *Context) (code Status)
- func (me *LoopbackFileSystem) Mknod(name string, mode uint32, dev uint32, context *Context) (code Status)
- func (me *LoopbackFileSystem) Open(name string, flags uint32, context *Context) (fuseFile File, status Status)
- func (me *LoopbackFileSystem) OpenDir(name string, context *Context) (stream chan DirEntry, status Status)
- func (me *LoopbackFileSystem) Readlink(name string, context *Context) (out string, code Status)
- func (me *LoopbackFileSystem) RemoveXAttr(name string, attr string, context *Context) Status
- func (me *LoopbackFileSystem) Rename(oldPath string, newPath string, context *Context) (code Status)
- func (me *LoopbackFileSystem) Rmdir(name string, context *Context) (code Status)
- func (me *LoopbackFileSystem) StatFs(name string) *StatfsOut
- func (me *LoopbackFileSystem) String() string
- func (me *LoopbackFileSystem) Symlink(pointedTo string, linkName string, context *Context) (code Status)
- func (me *LoopbackFileSystem) Truncate(path string, offset uint64, context *Context) (code Status)
- func (me *LoopbackFileSystem) Unlink(name string, context *Context) (code Status)
- func (me *LoopbackFileSystem) Utimens(path string, AtimeNs int64, MtimeNs int64, context *Context) (code Status)
- type MemNodeFs
- type MkdirIn
- type MknodIn
- type MountOptions
- type MountState
- func (me *MountState) BufferPoolStats() string
- func (me *MountState) KernelSettings() InitIn
- func (me *MountState) Latencies() map[string]float64
- func (me *MountState) Loop()
- func (me *MountState) Mount(mountPoint string, opts *MountOptions) error
- func (me *MountState) MountPoint() string
- func (me *MountState) OperationCounts() map[string]int
- func (me *MountState) SetRecordStatistics(record bool)
- func (me *MountState) Unmount() (err error)
- type NodeFileSystem
- type NotifyCode
- type NotifyInvalEntryOut
- type NotifyInvalInodeOut
- type NotifyPollWakeupOut
- type OpenIn
- type OpenOut
- type OutHeader
- type Owner
- type PathNodeFs
- func (me *PathNodeFs) AllFiles(name string, mask uint32) []WithFlags
- func (me *PathNodeFs) EntryNotify(dir string, name string) Status
- func (me *PathNodeFs) FileNotify(path string, off int64, length int64) Status
- func (me *PathNodeFs) ForgetClientInodes()
- func (me *PathNodeFs) LastNode(name string) (*Inode, []string)
- func (me *PathNodeFs) LookupNode(name string) *Inode
- func (me *PathNodeFs) Mount(path string, nodeFs NodeFileSystem, opts *FileSystemOptions) Status
- func (me *PathNodeFs) Node(name string) *Inode
- func (me *PathNodeFs) Notify(path string) Status
- func (me *PathNodeFs) OnMount(conn *FileSystemConnector)
- func (me *PathNodeFs) OnUnmount()
- func (me *PathNodeFs) Path(node *Inode) string
- func (me *PathNodeFs) RereadClientInodes()
- func (me *PathNodeFs) Root() FsNode
- func (me *PathNodeFs) String() string
- func (me *PathNodeFs) Unmount(path string) Status
- func (me *PathNodeFs) UnmountNode(node *Inode) Status
- type PathNodeFsOptions
- type PollIn
- type PollOut
- type PrefixFileSystem
- func (me *PrefixFileSystem) Access(name string, mode uint32, context *Context) (code Status)
- func (me *PrefixFileSystem) Chmod(name string, mode uint32, context *Context) (code Status)
- func (me *PrefixFileSystem) Chown(name string, uid uint32, gid uint32, context *Context) (code Status)
- func (me *PrefixFileSystem) Create(name string, flags uint32, mode uint32, context *Context) (file File, code Status)
- func (me *PrefixFileSystem) GetAttr(name string, context *Context) (*Attr, Status)
- func (me *PrefixFileSystem) GetXAttr(name string, attr string, context *Context) ([]byte, Status)
- func (me *PrefixFileSystem) Link(oldName string, newName string, context *Context) (code Status)
- func (me *PrefixFileSystem) ListXAttr(name string, context *Context) ([]string, Status)
- func (me *PrefixFileSystem) Mkdir(name string, mode uint32, context *Context) Status
- func (me *PrefixFileSystem) Mknod(name string, mode uint32, dev uint32, context *Context) Status
- func (me *PrefixFileSystem) OnMount(nodeFs *PathNodeFs)
- func (me *PrefixFileSystem) OnUnmount()
- func (me *PrefixFileSystem) Open(name string, flags uint32, context *Context) (file File, code Status)
- func (me *PrefixFileSystem) OpenDir(name string, context *Context) (stream chan DirEntry, status Status)
- func (me *PrefixFileSystem) Readlink(name string, context *Context) (string, Status)
- func (me *PrefixFileSystem) RemoveXAttr(name string, attr string, context *Context) Status
- func (me *PrefixFileSystem) Rename(oldName string, newName string, context *Context) (code Status)
- func (me *PrefixFileSystem) Rmdir(name string, context *Context) (code Status)
- func (me *PrefixFileSystem) SetXAttr(name string, attr string, data []byte, flags int, context *Context) Status
- func (me *PrefixFileSystem) String() string
- func (me *PrefixFileSystem) Symlink(value string, linkName string, context *Context) (code Status)
- func (me *PrefixFileSystem) Truncate(name string, offset uint64, context *Context) (code Status)
- func (me *PrefixFileSystem) Unlink(name string, context *Context) (code Status)
- func (me *PrefixFileSystem) Utimens(name string, AtimeNs int64, CtimeNs int64, context *Context) (code Status)
- type RawFileSystem
- type RawFsInit
- type ReadIn
- type ReadOnlyFile
- func (me *ReadOnlyFile) Chmod(mode uint32) Status
- func (me *ReadOnlyFile) Chown(uid uint32, gid uint32) Status
- func (me *ReadOnlyFile) Fsync(*FsyncIn) (code Status)
- func (me *ReadOnlyFile) String() string
- func (me *ReadOnlyFile) Truncate(size uint64) Status
- func (me *ReadOnlyFile) Write(input *WriteIn, data []byte) (uint32, Status)
- type ReadonlyFileSystem
- func (me *ReadonlyFileSystem) Access(name string, mode uint32, context *Context) (code Status)
- func (me *ReadonlyFileSystem) Chmod(name string, mode uint32, context *Context) (code Status)
- func (me *ReadonlyFileSystem) Chown(name string, uid uint32, gid uint32, context *Context) (code Status)
- func (me *ReadonlyFileSystem) Create(name string, flags uint32, mode uint32, context *Context) (file File, code Status)
- func (me *ReadonlyFileSystem) GetAttr(name string, context *Context) (*Attr, Status)
- func (me *ReadonlyFileSystem) GetXAttr(name string, attr string, context *Context) ([]byte, Status)
- func (me *ReadonlyFileSystem) Link(oldName string, newName string, context *Context) (code Status)
- func (me *ReadonlyFileSystem) ListXAttr(name string, context *Context) ([]string, Status)
- func (me *ReadonlyFileSystem) Mkdir(name string, mode uint32, context *Context) Status
- func (me *ReadonlyFileSystem) Mknod(name string, mode uint32, dev uint32, context *Context) Status
- func (me *ReadonlyFileSystem) OnMount(nodeFs *PathNodeFs)
- func (me *ReadonlyFileSystem) OnUnmount()
- func (me *ReadonlyFileSystem) Open(name string, flags uint32, context *Context) (file File, code Status)
- func (me *ReadonlyFileSystem) OpenDir(name string, context *Context) (stream chan DirEntry, status Status)
- func (me *ReadonlyFileSystem) Readlink(name string, context *Context) (string, Status)
- func (me *ReadonlyFileSystem) RemoveXAttr(name string, attr string, context *Context) Status
- func (me *ReadonlyFileSystem) Rename(oldName string, newName string, context *Context) (code Status)
- func (me *ReadonlyFileSystem) Rmdir(name string, context *Context) (code Status)
- func (me *ReadonlyFileSystem) SetXAttr(name string, attr string, data []byte, flags int, context *Context) Status
- func (me *ReadonlyFileSystem) String() string
- func (me *ReadonlyFileSystem) Symlink(value string, linkName string, context *Context) (code Status)
- func (me *ReadonlyFileSystem) Truncate(name string, offset uint64, context *Context) (code Status)
- func (me *ReadonlyFileSystem) Unlink(name string, context *Context) (code Status)
- func (me *ReadonlyFileSystem) Utimens(name string, AtimeNs int64, CtimeNs int64, context *Context) (code Status)
- type ReleaseIn
- type RenameIn
- type SetAttrIn
- type SetXAttrIn
- type StatfsOut
- type Status
- type WithFlags
- type WriteIn
- type WriteOut
Constants ¶
const ( FUSE_ROOT_ID = 1 FUSE_UNKNOWN_INO = 0xffffffff CUSE_UNRESTRICTED_IOCTL = (1 << 0) FUSE_LK_FLOCK = (1 << 0) FUSE_IOCTL_MAX_IOV = 256 FUSE_POLL_SCHEDULE_NOTIFY = (1 << 0) CUSE_INIT_INFO_MAX = 4096 S_IFDIR = syscall.S_IFDIR S_IFREG = syscall.S_IFREG S_IFLNK = syscall.S_IFLNK S_IFIFO = syscall.S_IFIFO CUSE_INIT = 4096 O_ANYWRITE = uint32(os.O_WRONLY | os.O_RDWR | os.O_APPEND | os.O_CREATE | os.O_TRUNC) )
const ( OK = Status(0) EACCES = Status(syscall.EACCES) EBUSY = Status(syscall.EBUSY) EINVAL = Status(syscall.EINVAL) EIO = Status(syscall.EIO) ENOENT = Status(syscall.ENOENT) ENOSYS = Status(syscall.ENOSYS) ENODATA = Status(syscall.ENODATA) ENOTDIR = Status(syscall.ENOTDIR) EPERM = Status(syscall.EPERM) ERANGE = Status(syscall.ERANGE) EXDEV = Status(syscall.EXDEV) EBADF = Status(syscall.EBADF) ENODEV = Status(syscall.ENODEV) EROFS = Status(syscall.EROFS) )
const ( NOTIFY_POLL = -1 NOTIFY_INVAL_INODE = -2 NOTIFY_INVAL_ENTRY = -3 NOTIFY_CODE_MAX = -4 )
const ( FATTR_MODE = (1 << 0) FATTR_UID = (1 << 1) FATTR_GID = (1 << 2) FATTR_SIZE = (1 << 3) FATTR_ATIME = (1 << 4) FATTR_MTIME = (1 << 5) FATTR_FH = (1 << 6) FATTR_ATIME_NOW = (1 << 7) FATTR_MTIME_NOW = (1 << 8) FATTR_LOCKOWNER = (1 << 9) )
const ( // OpenOut.Flags FOPEN_DIRECT_IO = (1 << 0) FOPEN_KEEP_CACHE = (1 << 1) FOPEN_NONSEEKABLE = (1 << 2) )
const ( WRITE_CACHE = (1 << 0) WRITE_LOCKOWNER = (1 << 1) )
const ( X_OK = 1 W_OK = 2 R_OK = 4 F_OK = 0 )
For AccessIn.Mask.
const ( CAP_ASYNC_READ = (1 << 0) CAP_POSIX_LOCKS = (1 << 1) CAP_FILE_OPS = (1 << 2) CAP_ATOMIC_O_TRUNC = (1 << 3) CAP_EXPORT_SUPPORT = (1 << 4) CAP_BIG_WRITES = (1 << 5) CAP_DONT_MASK = (1 << 6) CAP_SPLICE_WRITE = (1 << 7) CAP_SPLICE_MOVE = (1 << 8) CAP_SPLICE_READ = (1 << 9) )
To be set in InitIn/InitOut.Flags.
const ( FUSE_IOCTL_COMPAT = (1 << 0) FUSE_IOCTL_UNRESTRICTED = (1 << 1) FUSE_IOCTL_RETRY = (1 << 2) )
const AT_FDCWD = -100
const (
// Mask for GetAttrIn.Flags. If set, GetAttrIn has a file handle set.
FUSE_GETATTR_FH = (1 << 0)
)
const (
// The kernel caps writes at 128k.
MAX_KERNEL_WRITE = 128 * 1024
)
const PAGESIZE = 4096
const (
READ_LOCKOWNER = (1 << 1)
)
const RELEASE_FLUSH = (1 << 0)
Variables ¶
This section is empty.
Functions ¶
func CheckSuccess ¶
func CheckSuccess(e error)
func ModeToType ¶
func MountNodeFileSystem ¶
func MountNodeFileSystem(mountpoint string, nodeFs NodeFileSystem, opts *FileSystemOptions) (*MountState, *FileSystemConnector, error)
func Removexattr ¶
func ReverseJoin ¶
func VerboseTest ¶
func VerboseTest() bool
Types ¶
type Attr ¶
type Attr struct { Ino uint64 Size uint64 Blocks uint64 Atime uint64 Mtime uint64 Ctime uint64 Atimensec uint32 Mtimensec uint32 Ctimensec uint32 Mode uint32 Nlink uint32 Owner Rdev uint32 Blksize uint32 Padding uint32 }
func (*Attr) AccessTime ¶
func (*Attr) ChangeTime ¶
type BufferPool ¶
type BufferPoolImpl ¶
type BufferPoolImpl struct {
// contains filtered or unexported fields
}
BufferPool implements a pool of buffers that returns slices with capacity of a multiple of PAGESIZE, which have possibly been used, and may contain random contents.
func NewBufferPool ¶
func NewBufferPool() *BufferPoolImpl
func (*BufferPoolImpl) AllocBuffer ¶
func (me *BufferPoolImpl) AllocBuffer(size uint32) []byte
AllocBuffer creates a buffer of at least the given size. After use, it should be deallocated with FreeBuffer().
func (*BufferPoolImpl) FreeBuffer ¶
func (me *BufferPoolImpl) FreeBuffer(slice []byte)
FreeBuffer takes back a buffer if it was allocated through AllocBuffer. It is not an error to call FreeBuffer() on a slice obtained elsewhere.
func (*BufferPoolImpl) String ¶
func (me *BufferPoolImpl) String() string
type CuseInitOut ¶
type DataFile ¶
type DataFile struct { DefaultFile // contains filtered or unexported fields }
DataFile is for implementing read-only filesystems. This assumes we already have the data in memory.
func NewDataFile ¶
type DefaultFile ¶
type DefaultFile struct{}
DefaultFile returns ENOSYS for every operation.
func (*DefaultFile) Chmod ¶
func (me *DefaultFile) Chmod(perms uint32) Status
func (*DefaultFile) Flush ¶
func (me *DefaultFile) Flush() Status
func (*DefaultFile) Fsync ¶
func (me *DefaultFile) Fsync(*FsyncIn) (code Status)
func (*DefaultFile) GetAttr ¶
func (me *DefaultFile) GetAttr() (*Attr, Status)
func (*DefaultFile) InnerFile ¶
func (me *DefaultFile) InnerFile() File
func (*DefaultFile) Ioctl ¶
func (me *DefaultFile) Ioctl(input *IoctlIn) (output *IoctlOut, data []byte, code Status)
func (*DefaultFile) Read ¶
func (me *DefaultFile) Read(*ReadIn, BufferPool) ([]byte, Status)
func (*DefaultFile) Release ¶
func (me *DefaultFile) Release()
func (*DefaultFile) SetInode ¶
func (me *DefaultFile) SetInode(*Inode)
func (*DefaultFile) String ¶
func (me *DefaultFile) String() string
func (*DefaultFile) Truncate ¶
func (me *DefaultFile) Truncate(size uint64) Status
type DefaultFileSystem ¶
type DefaultFileSystem struct{}
DefaultFileSystem implements a FileSystem that returns ENOSYS for every operation.
func (*DefaultFileSystem) Access ¶
func (me *DefaultFileSystem) Access(name string, mode uint32, context *Context) (code Status)
func (*DefaultFileSystem) Chmod ¶
func (me *DefaultFileSystem) Chmod(name string, mode uint32, context *Context) (code Status)
func (*DefaultFileSystem) GetAttr ¶
func (me *DefaultFileSystem) GetAttr(name string, context *Context) (*Attr, Status)
DefaultFileSystem
func (*DefaultFileSystem) Link ¶
func (me *DefaultFileSystem) Link(oldName string, newName string, context *Context) (code Status)
func (*DefaultFileSystem) ListXAttr ¶
func (me *DefaultFileSystem) ListXAttr(name string, context *Context) ([]string, Status)
func (*DefaultFileSystem) Mkdir ¶
func (me *DefaultFileSystem) Mkdir(name string, mode uint32, context *Context) Status
func (*DefaultFileSystem) OnMount ¶
func (me *DefaultFileSystem) OnMount(nodeFs *PathNodeFs)
func (*DefaultFileSystem) OnUnmount ¶
func (me *DefaultFileSystem) OnUnmount()
func (*DefaultFileSystem) OpenDir ¶
func (me *DefaultFileSystem) OpenDir(name string, context *Context) (stream chan DirEntry, status Status)
func (*DefaultFileSystem) Readlink ¶
func (me *DefaultFileSystem) Readlink(name string, context *Context) (string, Status)
func (*DefaultFileSystem) RemoveXAttr ¶
func (me *DefaultFileSystem) RemoveXAttr(name string, attr string, context *Context) Status
func (*DefaultFileSystem) Rename ¶
func (me *DefaultFileSystem) Rename(oldName string, newName string, context *Context) (code Status)
func (*DefaultFileSystem) Rmdir ¶
func (me *DefaultFileSystem) Rmdir(name string, context *Context) (code Status)
func (*DefaultFileSystem) StatFs ¶
func (me *DefaultFileSystem) StatFs(name string) *StatfsOut
func (*DefaultFileSystem) String ¶
func (me *DefaultFileSystem) String() string
func (*DefaultFileSystem) Symlink ¶
func (me *DefaultFileSystem) Symlink(value string, linkName string, context *Context) (code Status)
func (*DefaultFileSystem) Truncate ¶
func (me *DefaultFileSystem) Truncate(name string, offset uint64, context *Context) (code Status)
type DefaultFsNode ¶
type DefaultFsNode struct {
// contains filtered or unexported fields
}
func (*DefaultFsNode) Access ¶
func (me *DefaultFsNode) Access(mode uint32, context *Context) (code Status)
func (*DefaultFsNode) Chmod ¶
func (me *DefaultFsNode) Chmod(file File, perms uint32, context *Context) (code Status)
func (*DefaultFsNode) Deletable ¶
func (me *DefaultFsNode) Deletable() bool
func (*DefaultFsNode) Flush ¶
func (me *DefaultFsNode) Flush(file File, openFlags uint32, context *Context) (code Status)
func (*DefaultFsNode) GetAttr ¶
func (me *DefaultFsNode) GetAttr(file File, context *Context) (fi *Attr, code Status)
func (*DefaultFsNode) GetXAttr ¶
func (me *DefaultFsNode) GetXAttr(attribute string, context *Context) (data []byte, code Status)
func (*DefaultFsNode) Inode ¶
func (me *DefaultFsNode) Inode() *Inode
func (*DefaultFsNode) ListXAttr ¶
func (me *DefaultFsNode) ListXAttr(context *Context) (attrs []string, code Status)
func (*DefaultFsNode) OnForget ¶
func (me *DefaultFsNode) OnForget()
func (*DefaultFsNode) Open ¶
func (me *DefaultFsNode) Open(flags uint32, context *Context) (file File, code Status)
func (*DefaultFsNode) OpenDir ¶
func (me *DefaultFsNode) OpenDir(context *Context) (chan DirEntry, Status)
func (*DefaultFsNode) RemoveXAttr ¶
func (me *DefaultFsNode) RemoveXAttr(attr string, context *Context) Status
func (*DefaultFsNode) Rmdir ¶
func (me *DefaultFsNode) Rmdir(name string, context *Context) (code Status)
func (*DefaultFsNode) SetInode ¶
func (me *DefaultFsNode) SetInode(node *Inode)
func (*DefaultFsNode) StatFs ¶
func (me *DefaultFsNode) StatFs() *StatfsOut
func (*DefaultFsNode) Truncate ¶
func (me *DefaultFsNode) Truncate(file File, size uint64, context *Context) (code Status)
type DefaultNodeFileSystem ¶
type DefaultNodeFileSystem struct { }
func (*DefaultNodeFileSystem) OnMount ¶
func (me *DefaultNodeFileSystem) OnMount(conn *FileSystemConnector)
func (*DefaultNodeFileSystem) OnUnmount ¶
func (me *DefaultNodeFileSystem) OnUnmount()
func (*DefaultNodeFileSystem) Root ¶
func (me *DefaultNodeFileSystem) Root() FsNode
func (*DefaultNodeFileSystem) String ¶
func (me *DefaultNodeFileSystem) String() string
type DefaultRawFileSystem ¶
type DefaultRawFileSystem struct{}
DefaultRawFileSystem returns ENOSYS for every operation.
func (*DefaultRawFileSystem) Access ¶
func (me *DefaultRawFileSystem) Access(header *InHeader, input *AccessIn) (code Status)
func (*DefaultRawFileSystem) Bmap ¶
func (me *DefaultRawFileSystem) Bmap(header *InHeader, input *BmapIn) (out *BmapOut, code Status)
func (*DefaultRawFileSystem) Flush ¶
func (me *DefaultRawFileSystem) Flush(header *InHeader, input *FlushIn) Status
func (*DefaultRawFileSystem) Forget ¶
func (me *DefaultRawFileSystem) Forget(h *InHeader, input *ForgetIn)
func (*DefaultRawFileSystem) Fsync ¶
func (me *DefaultRawFileSystem) Fsync(header *InHeader, input *FsyncIn) (code Status)
func (*DefaultRawFileSystem) FsyncDir ¶
func (me *DefaultRawFileSystem) FsyncDir(header *InHeader, input *FsyncIn) (code Status)
func (*DefaultRawFileSystem) GetAttr ¶
func (me *DefaultRawFileSystem) GetAttr(header *InHeader, input *GetAttrIn) (out *AttrOut, code Status)
func (*DefaultRawFileSystem) GetXAttrData ¶
func (me *DefaultRawFileSystem) GetXAttrData(header *InHeader, attr string) (data []byte, code Status)
func (*DefaultRawFileSystem) GetXAttrSize ¶
func (me *DefaultRawFileSystem) GetXAttrSize(header *InHeader, attr string) (size int, code Status)
func (*DefaultRawFileSystem) Init ¶
func (me *DefaultRawFileSystem) Init(init *RawFsInit)
func (*DefaultRawFileSystem) ListXAttr ¶
func (me *DefaultRawFileSystem) ListXAttr(header *InHeader) (data []byte, code Status)
func (*DefaultRawFileSystem) Lookup ¶
func (me *DefaultRawFileSystem) Lookup(h *InHeader, name string) (out *EntryOut, code Status)
func (*DefaultRawFileSystem) Poll ¶
func (me *DefaultRawFileSystem) Poll(header *InHeader, input *PollIn) (out *PollOut, code Status)
func (*DefaultRawFileSystem) Read ¶
func (me *DefaultRawFileSystem) Read(header *InHeader, input *ReadIn, bp BufferPool) ([]byte, Status)
func (*DefaultRawFileSystem) ReadDir ¶
func (me *DefaultRawFileSystem) ReadDir(header *InHeader, input *ReadIn) (*DirEntryList, Status)
func (*DefaultRawFileSystem) Readlink ¶
func (me *DefaultRawFileSystem) Readlink(header *InHeader) (out []byte, code Status)
func (*DefaultRawFileSystem) Release ¶
func (me *DefaultRawFileSystem) Release(header *InHeader, input *ReleaseIn)
func (*DefaultRawFileSystem) ReleaseDir ¶
func (me *DefaultRawFileSystem) ReleaseDir(header *InHeader, input *ReleaseIn)
func (*DefaultRawFileSystem) RemoveXAttr ¶
func (me *DefaultRawFileSystem) RemoveXAttr(header *InHeader, attr string) Status
func (*DefaultRawFileSystem) Rmdir ¶
func (me *DefaultRawFileSystem) Rmdir(header *InHeader, name string) (code Status)
func (*DefaultRawFileSystem) SetAttr ¶
func (me *DefaultRawFileSystem) SetAttr(header *InHeader, input *SetAttrIn) (out *AttrOut, code Status)
func (*DefaultRawFileSystem) SetXAttr ¶
func (me *DefaultRawFileSystem) SetXAttr(header *InHeader, input *SetXAttrIn, attr string, data []byte) Status
func (*DefaultRawFileSystem) StatFs ¶
func (me *DefaultRawFileSystem) StatFs(h *InHeader) *StatfsOut
type DevNullFile ¶
type DevNullFile struct {
DefaultFile
}
DevNullFile accepts any write, and always returns EOF.
func NewDevNullFile ¶
func NewDevNullFile() *DevNullFile
func (*DevNullFile) Flush ¶
func (me *DevNullFile) Flush() Status
func (*DevNullFile) Fsync ¶
func (me *DevNullFile) Fsync(*FsyncIn) (code Status)
func (*DevNullFile) Read ¶
func (me *DevNullFile) Read(input *ReadIn, bp BufferPool) ([]byte, Status)
func (*DevNullFile) String ¶
func (me *DevNullFile) String() string
func (*DevNullFile) Truncate ¶
func (me *DevNullFile) Truncate(size uint64) (code Status)
type DirEntryList ¶
type DirEntryList struct {
// contains filtered or unexported fields
}
func NewDirEntryList ¶
func NewDirEntryList(max int, off *uint64) *DirEntryList
func (*DirEntryList) AddDirEntry ¶
func (me *DirEntryList) AddDirEntry(e DirEntry) bool
func (*DirEntryList) AddString ¶
func (me *DirEntryList) AddString(name string, inode uint64, mode uint32) bool
func (*DirEntryList) Bytes ¶
func (me *DirEntryList) Bytes() []byte
type EntryOut ¶
type File ¶
type File interface { // Called upon registering the filehandle in the inode. SetInode(*Inode) // The String method is for debug printing. String() string // Wrappers around other File implementations, should return // the inner file here. InnerFile() File Read(*ReadIn, BufferPool) ([]byte, Status) Write(*WriteIn, []byte) (written uint32, code Status) Flush() Status Release() Fsync(*FsyncIn) (code Status) // The methods below may be called on closed files, due to // concurrency. In that case, you should return EBADF. Truncate(size uint64) Status GetAttr() (*Attr, Status) Chown(uid uint32, gid uint32) Status Chmod(perms uint32) Status Utimens(atimeNs int64, mtimeNs int64) Status }
A File object should be returned from FileSystem.Open and FileSystem.Create. Include DefaultFile into the struct to inherit a default null implementation.
TODO - should File be thread safe? TODO - should we pass a *Context argument?
type FileMode ¶
type FileMode uint32
type FileSystem ¶
type FileSystem interface { // Used for pretty printing. String() string // Attributes. This function is the main entry point, through // which FUSE discovers which files and directories exist. // // If the filesystem wants to implement hard-links, it should // return consistent non-zero FileInfo.Ino data. Using // hardlinks incurs a performance hit. GetAttr(name string, context *Context) (*Attr, Status) // These should update the file's ctime too. Chmod(name string, mode uint32, context *Context) (code Status) Chown(name string, uid uint32, gid uint32, context *Context) (code Status) Utimens(name string, AtimeNs int64, MtimeNs int64, context *Context) (code Status) Truncate(name string, size uint64, context *Context) (code Status) Access(name string, mode uint32, context *Context) (code Status) // Tree structure Link(oldName string, newName string, context *Context) (code Status) Mkdir(name string, mode uint32, context *Context) Status Mknod(name string, mode uint32, dev uint32, context *Context) Status Rename(oldName string, newName string, context *Context) (code Status) Rmdir(name string, context *Context) (code Status) Unlink(name string, context *Context) (code Status) // Extended attributes. GetXAttr(name string, attribute string, context *Context) (data []byte, code Status) ListXAttr(name string, context *Context) (attributes []string, code Status) RemoveXAttr(name string, attr string, context *Context) Status SetXAttr(name string, attr string, data []byte, flags int, context *Context) Status // Called after mount. OnMount(nodeFs *PathNodeFs) OnUnmount() // File handling. If opening for writing, the file's mtime // should be updated too. Open(name string, flags uint32, context *Context) (file File, code Status) Create(name string, flags uint32, mode uint32, context *Context) (file File, code Status) // Directory handling OpenDir(name string, context *Context) (stream chan DirEntry, code Status) // Symlinks. Symlink(value string, linkName string, context *Context) (code Status) Readlink(name string, context *Context) (string, Status) StatFs(name string) *StatfsOut }
A filesystem API that uses paths rather than inodes. A minimal file system should have at least a functional GetAttr method. Typically, each call happens in its own goroutine, so take care to make the file system thread-safe.
Include DefaultFileSystem to provide a default null implementation of required methods.
type FileSystemConnector ¶
type FileSystemConnector struct { DefaultRawFileSystem Debug bool // contains filtered or unexported fields }
FilesystemConnector is a raw FUSE filesystem that manages in-process mounts and inodes. Its job is twofold:
* It translates between the raw kernel interface (padded structs of int32 and int64) and the more abstract Go-ish NodeFileSystem interface.
* It manages mounting and unmounting of NodeFileSystems into the directory hierarchy
To achieve this, the connector only needs a pointer to the root node.
func NewFileSystemConnector ¶
func NewFileSystemConnector(nodeFs NodeFileSystem, opts *FileSystemOptions) (me *FileSystemConnector)
func (*FileSystemConnector) Access ¶
func (me *FileSystemConnector) Access(header *InHeader, input *AccessIn) (code Status)
func (*FileSystemConnector) EntryNotify ¶
func (me *FileSystemConnector) EntryNotify(dir *Inode, name string) Status
func (*FileSystemConnector) FileNotify ¶
func (me *FileSystemConnector) FileNotify(node *Inode, off int64, length int64) Status
func (*FileSystemConnector) Flush ¶
func (me *FileSystemConnector) Flush(header *InHeader, input *FlushIn) Status
func (*FileSystemConnector) Forget ¶
func (me *FileSystemConnector) Forget(h *InHeader, input *ForgetIn)
func (*FileSystemConnector) GetAttr ¶
func (me *FileSystemConnector) GetAttr(header *InHeader, input *GetAttrIn) (out *AttrOut, code Status)
func (*FileSystemConnector) GetXAttrData ¶
func (me *FileSystemConnector) GetXAttrData(header *InHeader, attribute string) (data []byte, code Status)
func (*FileSystemConnector) GetXAttrSize ¶
func (me *FileSystemConnector) GetXAttrSize(header *InHeader, attribute string) (sz int, code Status)
func (*FileSystemConnector) Init ¶
func (me *FileSystemConnector) Init(fsInit *RawFsInit)
func (*FileSystemConnector) ListXAttr ¶
func (me *FileSystemConnector) ListXAttr(header *InHeader) (data []byte, code Status)
func (*FileSystemConnector) Lookup ¶
func (me *FileSystemConnector) Lookup(header *InHeader, name string) (out *EntryOut, code Status)
func (*FileSystemConnector) LookupNode ¶
func (me *FileSystemConnector) LookupNode(parent *Inode, path string) *Inode
func (*FileSystemConnector) Mount ¶
func (me *FileSystemConnector) Mount(parent *Inode, name string, nodeFs NodeFileSystem, opts *FileSystemOptions) Status
Mount() generates a synthetic directory node, and mounts the file system there. If opts is nil, the mount options of the root file system are inherited. The encompassing filesystem should pretend the mount point does not exist. If it does, it will generate an Inode with the same, which will cause Mount() to return EBUSY.
Return values:
ENOENT: the directory containing the mount point does not exist.
EBUSY: the intended mount point already exists.
func (*FileSystemConnector) MountRoot ¶
func (me *FileSystemConnector) MountRoot(nodeFs NodeFileSystem, opts *FileSystemOptions)
func (*FileSystemConnector) Node ¶
func (me *FileSystemConnector) Node(parent *Inode, fullPath string) (*Inode, []string)
Finds a node within the currently known inodes, returns the last known node and the remaining unknown path components. If parent is nil, start from FUSE mountpoint.
func (*FileSystemConnector) Read ¶
func (me *FileSystemConnector) Read(header *InHeader, input *ReadIn, bp BufferPool) ([]byte, Status)
func (*FileSystemConnector) ReadDir ¶
func (me *FileSystemConnector) ReadDir(header *InHeader, input *ReadIn) (*DirEntryList, Status)
func (*FileSystemConnector) Readlink ¶
func (me *FileSystemConnector) Readlink(header *InHeader) (out []byte, code Status)
func (*FileSystemConnector) Release ¶
func (me *FileSystemConnector) Release(header *InHeader, input *ReleaseIn)
func (*FileSystemConnector) ReleaseDir ¶
func (me *FileSystemConnector) ReleaseDir(header *InHeader, input *ReleaseIn)
func (*FileSystemConnector) RemoveXAttr ¶
func (me *FileSystemConnector) RemoveXAttr(header *InHeader, attr string) Status
func (*FileSystemConnector) Rmdir ¶
func (me *FileSystemConnector) Rmdir(header *InHeader, name string) (code Status)
func (*FileSystemConnector) SetAttr ¶
func (me *FileSystemConnector) SetAttr(header *InHeader, input *SetAttrIn) (out *AttrOut, code Status)
func (*FileSystemConnector) SetXAttr ¶
func (me *FileSystemConnector) SetXAttr(header *InHeader, input *SetXAttrIn, attr string, data []byte) Status
func (*FileSystemConnector) StatFs ¶
func (me *FileSystemConnector) StatFs(header *InHeader) *StatfsOut
func (*FileSystemConnector) Unlink ¶
func (me *FileSystemConnector) Unlink(header *InHeader, name string) (code Status)
func (*FileSystemConnector) Unmount ¶
func (me *FileSystemConnector) Unmount(node *Inode) Status
Unmount() tries to unmount the given inode.
Returns the following error codes:
EINVAL: path does not exist, or is not a mount point.
EBUSY: there are open files, or submounts below this node.
type FileSystemOptions ¶
type FileSystemOptions struct { EntryTimeout time.Duration AttrTimeout time.Duration NegativeTimeout time.Duration // If set, replace all uids with given UID. // NewFileSystemOptions() will set this to the daemon's // uid/gid. *Owner // If set, use a more portable, but slower inode number // generation scheme. This will make inode numbers (exported // back to callers) stay within int32, which is necessary for // making stat() succeed in 32-bit programs. PortableInodes bool }
MountOptions contains time out options for a (Node)FileSystem. The default copied from libfuse and set in NewMountOptions() is (1s,1s,0s).
func NewFileSystemOptions ¶
func NewFileSystemOptions() *FileSystemOptions
type FsNode ¶
type FsNode interface { // The following are called by the FileSystemConnector Inode() *Inode SetInode(node *Inode) Lookup(name string, context *Context) (fi *Attr, node FsNode, code Status) // Deletable() should return true if this inode may be // discarded from the children list. This will be called from // within the treeLock critical section, so you cannot look at // other inodes. Deletable() bool // OnForget is called when the reference to this inode is // dropped from the tree. OnForget() // Misc. Access(mode uint32, context *Context) (code Status) Readlink(c *Context) ([]byte, Status) // Namespace operations Mknod(name string, mode uint32, dev uint32, context *Context) (fi *Attr, newNode FsNode, code Status) Mkdir(name string, mode uint32, context *Context) (fi *Attr, newNode FsNode, code Status) Unlink(name string, context *Context) (code Status) Rmdir(name string, context *Context) (code Status) Symlink(name string, content string, context *Context) (fi *Attr, newNode FsNode, code Status) Rename(oldName string, newParent FsNode, newName string, context *Context) (code Status) Link(name string, existing FsNode, context *Context) (fi *Attr, newNode FsNode, code Status) // Files Create(name string, flags uint32, mode uint32, context *Context) (file File, fi *Attr, newNode FsNode, code Status) Open(flags uint32, context *Context) (file File, code Status) OpenDir(context *Context) (chan DirEntry, Status) // XAttrs GetXAttr(attribute string, context *Context) (data []byte, code Status) RemoveXAttr(attr string, context *Context) Status SetXAttr(attr string, data []byte, flags int, context *Context) Status ListXAttr(context *Context) (attrs []string, code Status) // Attributes GetAttr(file File, context *Context) (fi *Attr, code Status) Chmod(file File, perms uint32, context *Context) (code Status) Chown(file File, uid uint32, gid uint32, context *Context) (code Status) Truncate(file File, size uint64, context *Context) (code Status) Utimens(file File, atime int64, mtime int64, context *Context) (code Status) StatFs() *StatfsOut }
type GcBufferPool ¶
type GcBufferPool struct { }
func NewGcBufferPool ¶
func NewGcBufferPool() *GcBufferPool
NewGcBufferPool is just a fallback to the standard allocation routines.
func (*GcBufferPool) AllocBuffer ¶
func (me *GcBufferPool) AllocBuffer(size uint32) []byte
func (*GcBufferPool) FreeBuffer ¶
func (me *GcBufferPool) FreeBuffer(slice []byte)
type GetXAttrIn ¶
func (*GetXAttrIn) String ¶
func (me *GetXAttrIn) String() string
type GetXAttrOut ¶
func (*GetXAttrOut) String ¶
func (me *GetXAttrOut) String() string
type HandleMap ¶
type HandleMap interface { Register(obj *Handled, asInt interface{}) uint64 Count() int Decode(uint64) *Handled Forget(uint64) *Handled Has(uint64) bool }
HandleMap translates objects in Go space to 64-bit handles that can be given out to -say- the linux kernel. It uses the free bits on x64_64 (16+3) to do an extra sanity check on the data. (Thanks to Russ Cox for this suggestion). In addition, it stores the object in a map, so the Go runtime will not garbage collect it.
The 32 bits version of this is a threadsafe wrapper around a map.
To use it, include Handled as first member of the structure you wish to export.
This structure is thread-safe.
func NewHandleMap ¶
NewHandleMap creates a new HandleMap. If verify is given, we use remaining bits in the handle to store sanity check bits.
type InHeader ¶
type InitOut ¶
type Inode ¶
type Inode struct {
// contains filtered or unexported fields
}
The inode reflects the kernel's idea of the inode. Inodes may be created automatically when the kernel does lookups inode, or by explicitly by calling Inode.CreateChild().
func (*Inode) Files ¶
Files() returns an opens file that have bits in common with the give mask. Use mask==0 to return all files.
func (*Inode) FsChildren ¶
FsChildren returns all the children from the same filesystem. It will skip mountpoints.
type InterruptIn ¶
type InterruptIn struct {
Unique uint64
}
type Kstatfs ¶
type LatencyArg ¶
type LatencyMap ¶
func NewLatencyMap ¶
func NewLatencyMap() *LatencyMap
func (*LatencyMap) AddMany ¶
func (me *LatencyMap) AddMany(args []LatencyArg)
func (*LatencyMap) Counts ¶
func (me *LatencyMap) Counts() map[string]int
func (*LatencyMap) Latencies ¶
func (me *LatencyMap) Latencies(unit float64) map[string]float64
Latencies returns a map. Use 1e-3 for unit to get ms results.
func (*LatencyMap) TopArgs ¶
func (me *LatencyMap) TopArgs(name string) []string
type LockingFileSystem ¶
type LockingFileSystem struct { // Should be public so people reusing can access the wrapped // FS. FileSystem // contains filtered or unexported fields }
This is a wrapper that makes a FileSystem threadsafe by trivially locking all operations. For improved performance, you should probably invent do your own locking inside the file system.
func NewLockingFileSystem ¶
func NewLockingFileSystem(pfs FileSystem) *LockingFileSystem
func (*LockingFileSystem) Access ¶
func (me *LockingFileSystem) Access(name string, mode uint32, context *Context) (code Status)
func (*LockingFileSystem) Chmod ¶
func (me *LockingFileSystem) Chmod(name string, mode uint32, context *Context) (code Status)
func (*LockingFileSystem) GetAttr ¶
func (me *LockingFileSystem) GetAttr(name string, context *Context) (*Attr, Status)
func (*LockingFileSystem) Link ¶
func (me *LockingFileSystem) Link(oldName string, newName string, context *Context) (code Status)
func (*LockingFileSystem) ListXAttr ¶
func (me *LockingFileSystem) ListXAttr(name string, context *Context) ([]string, Status)
func (*LockingFileSystem) Mkdir ¶
func (me *LockingFileSystem) Mkdir(name string, mode uint32, context *Context) Status
func (*LockingFileSystem) OnMount ¶
func (me *LockingFileSystem) OnMount(nodeFs *PathNodeFs)
func (*LockingFileSystem) OnUnmount ¶
func (me *LockingFileSystem) OnUnmount()
func (*LockingFileSystem) OpenDir ¶
func (me *LockingFileSystem) OpenDir(name string, context *Context) (stream chan DirEntry, status Status)
func (*LockingFileSystem) Readlink ¶
func (me *LockingFileSystem) Readlink(name string, context *Context) (string, Status)
func (*LockingFileSystem) RemoveXAttr ¶
func (me *LockingFileSystem) RemoveXAttr(name string, attr string, context *Context) Status
func (*LockingFileSystem) Rename ¶
func (me *LockingFileSystem) Rename(oldName string, newName string, context *Context) (code Status)
func (*LockingFileSystem) Rmdir ¶
func (me *LockingFileSystem) Rmdir(name string, context *Context) (code Status)
func (*LockingFileSystem) Symlink ¶
func (me *LockingFileSystem) Symlink(value string, linkName string, context *Context) (code Status)
func (*LockingFileSystem) Truncate ¶
func (me *LockingFileSystem) Truncate(name string, offset uint64, context *Context) (code Status)
type LockingRawFileSystem ¶
type LockingRawFileSystem struct { RawFileSystem // contains filtered or unexported fields }
func NewLockingRawFileSystem ¶
func NewLockingRawFileSystem(rfs RawFileSystem) *LockingRawFileSystem
func (*LockingRawFileSystem) Access ¶
func (me *LockingRawFileSystem) Access(header *InHeader, input *AccessIn) (code Status)
func (*LockingRawFileSystem) Flush ¶
func (me *LockingRawFileSystem) Flush(header *InHeader, input *FlushIn) Status
func (*LockingRawFileSystem) Forget ¶
func (me *LockingRawFileSystem) Forget(h *InHeader, input *ForgetIn)
func (*LockingRawFileSystem) Fsync ¶
func (me *LockingRawFileSystem) Fsync(header *InHeader, input *FsyncIn) (code Status)
func (*LockingRawFileSystem) FsyncDir ¶
func (me *LockingRawFileSystem) FsyncDir(header *InHeader, input *FsyncIn) (code Status)
func (*LockingRawFileSystem) GetAttr ¶
func (me *LockingRawFileSystem) GetAttr(header *InHeader, input *GetAttrIn) (out *AttrOut, code Status)
func (*LockingRawFileSystem) GetXAttrData ¶
func (me *LockingRawFileSystem) GetXAttrData(header *InHeader, attr string) (data []byte, code Status)
func (*LockingRawFileSystem) GetXAttrSize ¶
func (me *LockingRawFileSystem) GetXAttrSize(header *InHeader, attr string) (sz int, code Status)
func (*LockingRawFileSystem) ListXAttr ¶
func (me *LockingRawFileSystem) ListXAttr(header *InHeader) (data []byte, code Status)
func (*LockingRawFileSystem) Lookup ¶
func (me *LockingRawFileSystem) Lookup(h *InHeader, name string) (out *EntryOut, code Status)
func (*LockingRawFileSystem) Read ¶
func (me *LockingRawFileSystem) Read(header *InHeader, input *ReadIn, bp BufferPool) ([]byte, Status)
func (*LockingRawFileSystem) ReadDir ¶
func (me *LockingRawFileSystem) ReadDir(header *InHeader, input *ReadIn) (*DirEntryList, Status)
func (*LockingRawFileSystem) Readlink ¶
func (me *LockingRawFileSystem) Readlink(header *InHeader) (out []byte, code Status)
func (*LockingRawFileSystem) Release ¶
func (me *LockingRawFileSystem) Release(header *InHeader, input *ReleaseIn)
func (*LockingRawFileSystem) ReleaseDir ¶
func (me *LockingRawFileSystem) ReleaseDir(header *InHeader, h *ReleaseIn)
func (*LockingRawFileSystem) RemoveXAttr ¶
func (me *LockingRawFileSystem) RemoveXAttr(header *InHeader, attr string) Status
func (*LockingRawFileSystem) Rmdir ¶
func (me *LockingRawFileSystem) Rmdir(header *InHeader, name string) (code Status)
func (*LockingRawFileSystem) SetAttr ¶
func (me *LockingRawFileSystem) SetAttr(header *InHeader, input *SetAttrIn) (out *AttrOut, code Status)
func (*LockingRawFileSystem) SetXAttr ¶
func (me *LockingRawFileSystem) SetXAttr(header *InHeader, input *SetXAttrIn, attr string, data []byte) Status
type LoopbackFile ¶
type LoopbackFile struct { File *os.File DefaultFile }
LoopbackFile delegates all operations back to an underlying os.File.
func (*LoopbackFile) Chmod ¶
func (me *LoopbackFile) Chmod(mode uint32) Status
func (*LoopbackFile) Fsync ¶
func (me *LoopbackFile) Fsync(*FsyncIn) (code Status)
func (*LoopbackFile) GetAttr ¶
func (me *LoopbackFile) GetAttr() (*Attr, Status)
func (*LoopbackFile) Read ¶
func (me *LoopbackFile) Read(input *ReadIn, buffers BufferPool) ([]byte, Status)
func (*LoopbackFile) Release ¶
func (me *LoopbackFile) Release()
func (*LoopbackFile) String ¶
func (me *LoopbackFile) String() string
func (*LoopbackFile) Truncate ¶
func (me *LoopbackFile) Truncate(size uint64) Status
type LoopbackFileSystem ¶
type LoopbackFileSystem struct { Root string DefaultFileSystem }
func NewLoopbackFileSystem ¶
func NewLoopbackFileSystem(root string) (out *LoopbackFileSystem)
func (*LoopbackFileSystem) Access ¶
func (me *LoopbackFileSystem) Access(name string, mode uint32, context *Context) (code Status)
func (*LoopbackFileSystem) Chmod ¶
func (me *LoopbackFileSystem) Chmod(path string, mode uint32, context *Context) (code Status)
func (*LoopbackFileSystem) GetAttr ¶
func (me *LoopbackFileSystem) GetAttr(name string, context *Context) (a *Attr, code Status)
func (*LoopbackFileSystem) GetPath ¶
func (me *LoopbackFileSystem) GetPath(relPath string) string
func (*LoopbackFileSystem) Link ¶
func (me *LoopbackFileSystem) Link(orig string, newName string, context *Context) (code Status)
func (*LoopbackFileSystem) ListXAttr ¶
func (me *LoopbackFileSystem) ListXAttr(name string, context *Context) ([]string, Status)
func (*LoopbackFileSystem) Mkdir ¶
func (me *LoopbackFileSystem) Mkdir(path string, mode uint32, context *Context) (code Status)
func (*LoopbackFileSystem) OpenDir ¶
func (me *LoopbackFileSystem) OpenDir(name string, context *Context) (stream chan DirEntry, status Status)
func (*LoopbackFileSystem) Readlink ¶
func (me *LoopbackFileSystem) Readlink(name string, context *Context) (out string, code Status)
func (*LoopbackFileSystem) RemoveXAttr ¶
func (me *LoopbackFileSystem) RemoveXAttr(name string, attr string, context *Context) Status
func (*LoopbackFileSystem) Rename ¶
func (me *LoopbackFileSystem) Rename(oldPath string, newPath string, context *Context) (code Status)
func (*LoopbackFileSystem) Rmdir ¶
func (me *LoopbackFileSystem) Rmdir(name string, context *Context) (code Status)
func (*LoopbackFileSystem) StatFs ¶
func (me *LoopbackFileSystem) StatFs(name string) *StatfsOut
func (*LoopbackFileSystem) String ¶
func (me *LoopbackFileSystem) String() string
func (*LoopbackFileSystem) Symlink ¶
func (me *LoopbackFileSystem) Symlink(pointedTo string, linkName string, context *Context) (code Status)
func (*LoopbackFileSystem) Truncate ¶
func (me *LoopbackFileSystem) Truncate(path string, offset uint64, context *Context) (code Status)
type MemNodeFs ¶
type MemNodeFs struct { DefaultNodeFileSystem // contains filtered or unexported fields }
func NewMemNodeFs ¶
type MountOptions ¶
type MountOptions struct { AllowOther bool // Options are passed as -o string to fusermount. Options []string // Default is _DEFAULT_BACKGROUND_TASKS, 12. This numbers // controls the allowed number of requests that relate to // async I/O. Concurrency for synchronous I/O is not limited. MaxBackground int // Write size to use. If 0, use default. This number is // capped at the kernel maximum. MaxWrite int // If IgnoreSecurityLabels is set, all security related xattr // requests will return NO_DATA without passing through the // user defined filesystem. You should only set this if you // file system implements extended attributes, and you are not // interested in security labels. IgnoreSecurityLabels bool // ignoring labels should be provided as a fusermount mount option. }
type MountState ¶
type MountState struct { // Dump debug info onto stdout. Debug bool // contains filtered or unexported fields }
MountState contains the logic for reading from the FUSE device and translating it to RawFileSystem interface calls.
func NewMountState ¶
func NewMountState(fs RawFileSystem) *MountState
func (*MountState) BufferPoolStats ¶
func (me *MountState) BufferPoolStats() string
func (*MountState) KernelSettings ¶
func (me *MountState) KernelSettings() InitIn
func (*MountState) Latencies ¶
func (me *MountState) Latencies() map[string]float64
func (*MountState) Loop ¶
func (me *MountState) Loop()
Loop initiates the FUSE loop. Normally, callers should run Loop() and wait for it to exit, but tests will want to run this in a goroutine.
Each filesystem operation executes in a separate goroutine.
func (*MountState) Mount ¶
func (me *MountState) Mount(mountPoint string, opts *MountOptions) error
Mount filesystem on mountPoint.
func (*MountState) MountPoint ¶
func (me *MountState) MountPoint() string
func (*MountState) OperationCounts ¶
func (me *MountState) OperationCounts() map[string]int
func (*MountState) SetRecordStatistics ¶
func (me *MountState) SetRecordStatistics(record bool)
func (*MountState) Unmount ¶
func (me *MountState) Unmount() (err error)
type NodeFileSystem ¶
type NodeFileSystem interface { OnUnmount() OnMount(conn *FileSystemConnector) Root() FsNode // Used for debug outputs String() string }
NodeFileSystem is a high level API that resembles the kernel's idea of what an FS looks like. NodeFileSystems can have multiple hard-links to one file, for example. It is also suited if the data to represent fits in memory: you can construct FsNode at mount time, and the filesystem will be ready.
type NotifyCode ¶
type NotifyCode int
type NotifyInvalEntryOut ¶
type NotifyInvalInodeOut ¶
type NotifyPollWakeupOut ¶
type NotifyPollWakeupOut struct {
Kh uint64
}
type Owner ¶
func CurrentOwner ¶
func CurrentOwner() *Owner
type PathNodeFs ¶
type PathNodeFs struct { Debug bool // contains filtered or unexported fields }
PathNodeFs is the file system that can translate an inode back to a path. The path name is then used to call into an object that has the FileSystem interface.
Lookups (ie. FileSystem.GetAttr) may return a inode number in its return value. The inode number ("clientInode") is used to indicate linked files. The clientInode is never exported back to the kernel; it is only used to maintain a list of all names of an inode.
func NewPathNodeFs ¶
func NewPathNodeFs(fs FileSystem, opts *PathNodeFsOptions) *PathNodeFs
func (*PathNodeFs) EntryNotify ¶
func (me *PathNodeFs) EntryNotify(dir string, name string) Status
func (*PathNodeFs) FileNotify ¶
func (me *PathNodeFs) FileNotify(path string, off int64, length int64) Status
func (*PathNodeFs) ForgetClientInodes ¶
func (me *PathNodeFs) ForgetClientInodes()
Forgets all known information on client inodes.
func (*PathNodeFs) LookupNode ¶
func (me *PathNodeFs) LookupNode(name string) *Inode
Like node, but use Lookup to discover inodes we may not have yet.
func (*PathNodeFs) Mount ¶
func (me *PathNodeFs) Mount(path string, nodeFs NodeFileSystem, opts *FileSystemOptions) Status
func (*PathNodeFs) Node ¶
func (me *PathNodeFs) Node(name string) *Inode
func (*PathNodeFs) Notify ¶
func (me *PathNodeFs) Notify(path string) Status
func (*PathNodeFs) OnMount ¶
func (me *PathNodeFs) OnMount(conn *FileSystemConnector)
func (*PathNodeFs) OnUnmount ¶
func (me *PathNodeFs) OnUnmount()
func (*PathNodeFs) Path ¶
func (me *PathNodeFs) Path(node *Inode) string
func (*PathNodeFs) RereadClientInodes ¶
func (me *PathNodeFs) RereadClientInodes()
Rereads all inode numbers for all known files.
func (*PathNodeFs) Root ¶
func (me *PathNodeFs) Root() FsNode
func (*PathNodeFs) String ¶
func (me *PathNodeFs) String() string
func (*PathNodeFs) Unmount ¶
func (me *PathNodeFs) Unmount(path string) Status
func (*PathNodeFs) UnmountNode ¶
func (me *PathNodeFs) UnmountNode(node *Inode) Status
type PathNodeFsOptions ¶
type PathNodeFsOptions struct { // If ClientInodes is set, use Inode returned from GetAttr to // find hard-linked files. ClientInodes bool }
type PrefixFileSystem ¶
type PrefixFileSystem struct { FileSystem Prefix string }
PrefixFileSystem adds a path prefix to incoming calls.
func (*PrefixFileSystem) Access ¶
func (me *PrefixFileSystem) Access(name string, mode uint32, context *Context) (code Status)
func (*PrefixFileSystem) Chmod ¶
func (me *PrefixFileSystem) Chmod(name string, mode uint32, context *Context) (code Status)
func (*PrefixFileSystem) GetAttr ¶
func (me *PrefixFileSystem) GetAttr(name string, context *Context) (*Attr, Status)
func (*PrefixFileSystem) Link ¶
func (me *PrefixFileSystem) Link(oldName string, newName string, context *Context) (code Status)
func (*PrefixFileSystem) ListXAttr ¶
func (me *PrefixFileSystem) ListXAttr(name string, context *Context) ([]string, Status)
func (*PrefixFileSystem) Mkdir ¶
func (me *PrefixFileSystem) Mkdir(name string, mode uint32, context *Context) Status
func (*PrefixFileSystem) OnMount ¶
func (me *PrefixFileSystem) OnMount(nodeFs *PathNodeFs)
func (*PrefixFileSystem) OnUnmount ¶
func (me *PrefixFileSystem) OnUnmount()
func (*PrefixFileSystem) OpenDir ¶
func (me *PrefixFileSystem) OpenDir(name string, context *Context) (stream chan DirEntry, status Status)
func (*PrefixFileSystem) Readlink ¶
func (me *PrefixFileSystem) Readlink(name string, context *Context) (string, Status)
func (*PrefixFileSystem) RemoveXAttr ¶
func (me *PrefixFileSystem) RemoveXAttr(name string, attr string, context *Context) Status
func (*PrefixFileSystem) Rename ¶
func (me *PrefixFileSystem) Rename(oldName string, newName string, context *Context) (code Status)
func (*PrefixFileSystem) Rmdir ¶
func (me *PrefixFileSystem) Rmdir(name string, context *Context) (code Status)
func (*PrefixFileSystem) String ¶
func (me *PrefixFileSystem) String() string
func (*PrefixFileSystem) Symlink ¶
func (me *PrefixFileSystem) Symlink(value string, linkName string, context *Context) (code Status)
func (*PrefixFileSystem) Truncate ¶
func (me *PrefixFileSystem) Truncate(name string, offset uint64, context *Context) (code Status)
type RawFileSystem ¶
type RawFileSystem interface { Lookup(header *InHeader, name string) (out *EntryOut, status Status) Forget(header *InHeader, input *ForgetIn) // Attributes. GetAttr(header *InHeader, input *GetAttrIn) (out *AttrOut, code Status) SetAttr(header *InHeader, input *SetAttrIn) (out *AttrOut, code Status) // Modifying structure. Mknod(header *InHeader, input *MknodIn, name string) (out *EntryOut, code Status) Mkdir(header *InHeader, input *MkdirIn, name string) (out *EntryOut, code Status) Unlink(header *InHeader, name string) (code Status) Rmdir(header *InHeader, name string) (code Status) Rename(header *InHeader, input *RenameIn, oldName string, newName string) (code Status) Link(header *InHeader, input *LinkIn, filename string) (out *EntryOut, code Status) Symlink(header *InHeader, pointedTo string, linkName string) (out *EntryOut, code Status) Readlink(header *InHeader) (out []byte, code Status) Access(header *InHeader, input *AccessIn) (code Status) // Extended attributes. GetXAttrSize(header *InHeader, attr string) (sz int, code Status) GetXAttrData(header *InHeader, attr string) (data []byte, code Status) ListXAttr(header *InHeader) (attributes []byte, code Status) SetXAttr(header *InHeader, input *SetXAttrIn, attr string, data []byte) Status RemoveXAttr(header *InHeader, attr string) (code Status) // File handling. Create(header *InHeader, input *CreateIn, name string) (flags uint32, handle uint64, out *EntryOut, code Status) Open(header *InHeader, input *OpenIn) (flags uint32, handle uint64, status Status) Read(*InHeader, *ReadIn, BufferPool) ([]byte, Status) Release(header *InHeader, input *ReleaseIn) Write(*InHeader, *WriteIn, []byte) (written uint32, code Status) Flush(header *InHeader, input *FlushIn) Status Fsync(*InHeader, *FsyncIn) (code Status) // Directory handling OpenDir(header *InHeader, input *OpenIn) (flags uint32, handle uint64, status Status) ReadDir(header *InHeader, input *ReadIn) (*DirEntryList, Status) ReleaseDir(header *InHeader, input *ReleaseIn) FsyncDir(header *InHeader, input *FsyncIn) (code Status) // Ioctl(header *InHeader, input *IoctlIn) (output *IoctlOut, data []byte, code Status) StatFs(header *InHeader) *StatfsOut // Provide callbacks for pushing notifications to the kernel. Init(params *RawFsInit) }
RawFileSystem is an interface close to the FUSE wire protocol.
Unless you really know what you are doing, you should not implement this, but rather the FileSystem interface; the details of getting interactions with open files, renames, and threading right etc. are somewhat tricky and not very interesting.
Include DefaultRawFileSystem to inherit a null implementation.
type RawFsInit ¶
type RawFsInit struct { InodeNotify func(*NotifyInvalInodeOut) Status EntryNotify func(parent uint64, name string) Status }
Talk back to FUSE.
InodeNotify invalidates the information associated with the inode (ie. data cache, attributes, etc.)
EntryNotify should be used if the existence status of an entry changes, (ie. to notify of creation or deletion of the file).
Somewhat confusingly, InodeNotify for a file that stopped to exist will give the correct result for Lstat (ENOENT), but the kernel will still issue file Open() on the inode.
type ReadIn ¶
type ReadOnlyFile ¶
type ReadOnlyFile struct {
File
}
ReadOnlyFile is a wrapper that denies writable operations
func (*ReadOnlyFile) Chmod ¶
func (me *ReadOnlyFile) Chmod(mode uint32) Status
func (*ReadOnlyFile) Fsync ¶
func (me *ReadOnlyFile) Fsync(*FsyncIn) (code Status)
func (*ReadOnlyFile) String ¶
func (me *ReadOnlyFile) String() string
func (*ReadOnlyFile) Truncate ¶
func (me *ReadOnlyFile) Truncate(size uint64) Status
type ReadonlyFileSystem ¶
type ReadonlyFileSystem struct {
FileSystem
}
This is a wrapper that only exposes read-only operations.
func (*ReadonlyFileSystem) Access ¶
func (me *ReadonlyFileSystem) Access(name string, mode uint32, context *Context) (code Status)
func (*ReadonlyFileSystem) Chmod ¶
func (me *ReadonlyFileSystem) Chmod(name string, mode uint32, context *Context) (code Status)
func (*ReadonlyFileSystem) GetAttr ¶
func (me *ReadonlyFileSystem) GetAttr(name string, context *Context) (*Attr, Status)
func (*ReadonlyFileSystem) Link ¶
func (me *ReadonlyFileSystem) Link(oldName string, newName string, context *Context) (code Status)
func (*ReadonlyFileSystem) ListXAttr ¶
func (me *ReadonlyFileSystem) ListXAttr(name string, context *Context) ([]string, Status)
func (*ReadonlyFileSystem) Mkdir ¶
func (me *ReadonlyFileSystem) Mkdir(name string, mode uint32, context *Context) Status
func (*ReadonlyFileSystem) OnMount ¶
func (me *ReadonlyFileSystem) OnMount(nodeFs *PathNodeFs)
func (*ReadonlyFileSystem) OnUnmount ¶
func (me *ReadonlyFileSystem) OnUnmount()
func (*ReadonlyFileSystem) OpenDir ¶
func (me *ReadonlyFileSystem) OpenDir(name string, context *Context) (stream chan DirEntry, status Status)
func (*ReadonlyFileSystem) Readlink ¶
func (me *ReadonlyFileSystem) Readlink(name string, context *Context) (string, Status)
func (*ReadonlyFileSystem) RemoveXAttr ¶
func (me *ReadonlyFileSystem) RemoveXAttr(name string, attr string, context *Context) Status
func (*ReadonlyFileSystem) Rename ¶
func (me *ReadonlyFileSystem) Rename(oldName string, newName string, context *Context) (code Status)
func (*ReadonlyFileSystem) Rmdir ¶
func (me *ReadonlyFileSystem) Rmdir(name string, context *Context) (code Status)
func (*ReadonlyFileSystem) String ¶
func (me *ReadonlyFileSystem) String() string
func (*ReadonlyFileSystem) Symlink ¶
func (me *ReadonlyFileSystem) Symlink(value string, linkName string, context *Context) (code Status)
func (*ReadonlyFileSystem) Truncate ¶
func (me *ReadonlyFileSystem) Truncate(name string, offset uint64, context *Context) (code Status)
type SetAttrIn ¶
type SetXAttrIn ¶
func (*SetXAttrIn) String ¶
func (me *SetXAttrIn) String() string
type Status ¶
type Status int32
type WithFlags ¶
type WithFlags struct { File // For debugging. Description string // Put FOPEN_* flags here. FuseFlags uint32 // O_RDWR, O_TRUNCATE, etc. OpenFlags uint32 }
Wrap a File return in this to set FUSE flags. Also used internally to store open file data.
Source Files ¶
- api.go
- attr.go
- bufferpool.go
- copy.go
- default.go
- defaultfile.go
- defaultnode.go
- defaultraw.go
- direntry.go
- files.go
- fsconnector.go
- fsmount.go
- fsops.go
- fuse.go
- handle.go
- inode.go
- latencymap.go
- lockingfs.go
- loopback.go
- memnode.go
- misc.go
- mount.go
- mountstate.go
- opcode.go
- pathfs.go
- prefixfs.go
- readonlyfs.go
- request.go
- syscall.go
- typeprint.go
- types.go
- version.go