Documentation ¶
Index ¶
- Constants
- Variables
- func Dup(value []byte) []byte
- func GetTgid(pid uint32) (tgid *int32, err error)
- func LogPanic(err *error)
- func MaxInt(a, b int) int
- func MaxInt64(a, b int64) int64
- func MaxUInt32(a, b uint32) uint32
- func MaxUInt64(a, b uint64) uint64
- func MinInt(a, b int) int
- func MinInt64(a, b int64) int64
- func MinUInt32(a, b uint32) uint32
- func MinUInt64(a, b uint64) uint64
- func NilStr(v *string) string
- func PBool(v bool) *bool
- func PInt32(v int32) *int32
- func PInt64(v int64) *int64
- func PString(v string) *string
- func PTime(v time.Time) *time.Time
- func PUInt32(v uint32) *uint32
- func PUInt64(v uint64) *uint64
- func RandStringBytesMaskImprSrc(n int) string
- func TryUnmountFS(mountPoint string) (err error)
- type Buffer
- type BufferPool
- type DirHandle
- type DirHandleEntry
- type DirInodeData
- type FileHandle
- type FileSystem
- func (fs *FileSystem) CreateFile(ctx context.Context, op *fuseops.CreateFileOp) (err error)
- func (fs *FileSystem) FlushFile(ctx context.Context, op *fuseops.FlushFileOp) (err error)
- func (fs *FileSystem) ForgetInode(ctx context.Context, op *fuseops.ForgetInodeOp) (err error)
- func (fs *FileSystem) GetInodeAttributes(ctx context.Context, op *fuseops.GetInodeAttributesOp) (err error)
- func (fs *FileSystem) GetXattr(ctx context.Context, op *fuseops.GetXattrOp) (err error)
- func (fs *FileSystem) ListXattr(ctx context.Context, op *fuseops.ListXattrOp) (err error)
- func (fs *FileSystem) LookUpInode(ctx context.Context, op *fuseops.LookUpInodeOp) (err error)
- func (fs *FileSystem) MkDir(ctx context.Context, op *fuseops.MkDirOp) (err error)
- func (fs *FileSystem) Mount(mount *Mount)
- func (fs *FileSystem) MountAll(mounts []*Mount)
- func (fs *FileSystem) OpenDir(ctx context.Context, op *fuseops.OpenDirOp) (err error)
- func (fs *FileSystem) OpenFile(ctx context.Context, op *fuseops.OpenFileOp) (err error)
- func (fs *FileSystem) ReadDir(ctx context.Context, op *fuseops.ReadDirOp) (err error)
- func (fs *FileSystem) ReadFile(ctx context.Context, op *fuseops.ReadFileOp) (err error)
- func (fs *FileSystem) ReleaseDirHandle(ctx context.Context, op *fuseops.ReleaseDirHandleOp) (err error)
- func (fs *FileSystem) ReleaseFileHandle(ctx context.Context, op *fuseops.ReleaseFileHandleOp) (err error)
- func (fs *FileSystem) RemoveXattr(ctx context.Context, op *fuseops.RemoveXattrOp) (err error)
- func (fs *FileSystem) Rename(ctx context.Context, op *fuseops.RenameOp) (err error)
- func (fs *FileSystem) RmDir(ctx context.Context, op *fuseops.RmDirOp) (err error)
- func (fs *FileSystem) SetInodeAttributes(ctx context.Context, op *fuseops.SetInodeAttributesOp) (err error)
- func (fs *FileSystem) SetXattr(ctx context.Context, op *fuseops.SetXattrOp) (err error)
- func (fs *FileSystem) SigUsr1()
- func (fs *FileSystem) StatFS(ctx context.Context, op *fuseops.StatFSOp) error
- func (fs *FileSystem) SyncFile(ctx context.Context, op *fuseops.SyncFileOp) (err error)
- func (fs *FileSystem) Unlink(ctx context.Context, op *fuseops.UnlinkOp) (err error)
- func (fs *FileSystem) Unmount(mountPoint string)
- func (fs *FileSystem) WriteFile(ctx context.Context, op *fuseops.WriteFileOp) (err error)
- type Flags
- type FusePanicLogger
- func (fs FusePanicLogger) CreateFile(ctx context.Context, op *fuseops.CreateFileOp) (err error)
- func (fs FusePanicLogger) CreateLink(ctx context.Context, op *fuseops.CreateLinkOp) (err error)
- func (fs FusePanicLogger) CreateSymlink(ctx context.Context, op *fuseops.CreateSymlinkOp) (err error)
- func (fs FusePanicLogger) Destroy()
- func (fs FusePanicLogger) Fallocate(ctx context.Context, op *fuseops.FallocateOp) (err error)
- func (fs FusePanicLogger) FlushFile(ctx context.Context, op *fuseops.FlushFileOp) (err error)
- func (fs FusePanicLogger) ForgetInode(ctx context.Context, op *fuseops.ForgetInodeOp) (err error)
- func (fs FusePanicLogger) GetInodeAttributes(ctx context.Context, op *fuseops.GetInodeAttributesOp) (err error)
- func (fs FusePanicLogger) GetXattr(ctx context.Context, op *fuseops.GetXattrOp) (err error)
- func (fs FusePanicLogger) ListXattr(ctx context.Context, op *fuseops.ListXattrOp) (err error)
- func (fs FusePanicLogger) LookUpInode(ctx context.Context, op *fuseops.LookUpInodeOp) (err error)
- func (fs FusePanicLogger) MkDir(ctx context.Context, op *fuseops.MkDirOp) (err error)
- func (fs FusePanicLogger) MkNode(ctx context.Context, op *fuseops.MkNodeOp) (err error)
- func (fs FusePanicLogger) OpenDir(ctx context.Context, op *fuseops.OpenDirOp) (err error)
- func (fs FusePanicLogger) OpenFile(ctx context.Context, op *fuseops.OpenFileOp) (err error)
- func (fs FusePanicLogger) ReadDir(ctx context.Context, op *fuseops.ReadDirOp) (err error)
- func (fs FusePanicLogger) ReadFile(ctx context.Context, op *fuseops.ReadFileOp) (err error)
- func (fs FusePanicLogger) ReadSymlink(ctx context.Context, op *fuseops.ReadSymlinkOp) (err error)
- func (fs FusePanicLogger) ReleaseDirHandle(ctx context.Context, op *fuseops.ReleaseDirHandleOp) (err error)
- func (fs FusePanicLogger) ReleaseFileHandle(ctx context.Context, op *fuseops.ReleaseFileHandleOp) (err error)
- func (fs FusePanicLogger) RemoveXattr(ctx context.Context, op *fuseops.RemoveXattrOp) (err error)
- func (fs FusePanicLogger) Rename(ctx context.Context, op *fuseops.RenameOp) (err error)
- func (fs FusePanicLogger) RmDir(ctx context.Context, op *fuseops.RmDirOp) (err error)
- func (fs FusePanicLogger) SetInodeAttributes(ctx context.Context, op *fuseops.SetInodeAttributesOp) (err error)
- func (fs FusePanicLogger) SetXattr(ctx context.Context, op *fuseops.SetXattrOp) (err error)
- func (fs FusePanicLogger) StatFS(ctx context.Context, op *fuseops.StatFSOp) (err error)
- func (fs FusePanicLogger) SyncFile(ctx context.Context, op *fuseops.SyncFileOp) (err error)
- func (fs FusePanicLogger) Unlink(ctx context.Context, op *fuseops.UnlinkOp) (err error)
- func (fs FusePanicLogger) WriteFile(ctx context.Context, op *fuseops.WriteFileOp) (err error)
- type Inode
- func (parent *Inode) Create(name string, metadata fuseops.OpMetadata) (inode *Inode, fh *FileHandle)
- func (inode *Inode) DeRef(n uint64) (stale bool)
- func (inode *Inode) FullName() *string
- func (inode *Inode) GetAttributes() (*fuseops.InodeAttributes, error)
- func (inode *Inode) GetXattr(name string) ([]byte, error)
- func (inode *Inode) InflateAttributes() (attr fuseops.InodeAttributes)
- func (inode *Inode) ListXattr() ([]string, error)
- func (parent *Inode) LookUp(name string) (inode *Inode, err error)
- func (parent *Inode) LookUpInodeDir(name string, c chan storage.ListBlobsOutput, errc chan error)
- func (parent *Inode) LookUpInodeMaybeDir(name string, fullName string) (inode *Inode, err error)
- func (parent *Inode) LookUpInodeNotDir(name string, c chan storage.HeadBlobOutput, errc chan error)
- func (parent *Inode) MkDir(name string) (inode *Inode, err error)
- func (inode *Inode) OpenDir() (dh *DirHandle)
- func (inode *Inode) OpenFile(metadata fuseops.OpMetadata) (fh *FileHandle, err error)
- func (inode *Inode) Ref()
- func (inode *Inode) RemoveXattr(name string) error
- func (parent *Inode) Rename(from string, newParent *Inode, to string) (err error)
- func (inode *Inode) ResetForUnmount()
- func (parent *Inode) RmDir(name string) (err error)
- func (inode *Inode) SetFromBlobItem(item *storage.BlobItemOutput)
- func (inode *Inode) SetXattr(name string, value []byte, flags uint32) error
- func (inode *Inode) ToDir()
- func (parent *Inode) Unlink(name string) (err error)
- type InodeAttributes
- type MBuf
- func (mb *MBuf) Close() error
- func (mb *MBuf) Free()
- func (mb *MBuf) Full() bool
- func (mb MBuf) Init(h *BufferPool, size uint64, block bool) *MBuf
- func (mb *MBuf) Len() (length int)
- func (mb *MBuf) Read(p []byte) (n int, err error)
- func (mb *MBuf) Reset()
- func (mb *MBuf) Seek(offset int64, whence int) (int64, error)
- func (mb *MBuf) Write(p []byte) (n int, err error)
- func (mb *MBuf) WriteFrom(r io.Reader) (n int, err error)
- type Mount
- type ReadBuffer
- type ReaderProvider
- type Ticket
Constants ¶
const ( MaxReadHead = uint32(400 * 1024 * 1024) ReadHeadChunk = uint32(20 * 1024 * 1024) )
const BuffSize = 5 * 1024 * 1024
Variables ¶
var TIMEMAX = time.Unix(1<<63-62135596801, 999999999)
Functions ¶
func TryUnmountFS ¶
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
func (*Buffer) ReInit ¶
func (b *Buffer) ReInit(r ReaderProvider)
type BufferPool ¶
type BufferPool struct {
// contains filtered or unexported fields
}
func (*BufferPool) Free ¶
func (pool *BufferPool) Free(buf []byte)
func (BufferPool) Init ¶
func (pool BufferPool) Init() *BufferPool
func (*BufferPool) MaybeGC ¶
func (pool *BufferPool) MaybeGC()
func (*BufferPool) RequestBuffer ¶
func (pool *BufferPool) RequestBuffer() (buf []byte)
func (*BufferPool) RequestMultiple ¶
func (pool *BufferPool) RequestMultiple(size uint64, block bool) (buffers [][]byte)
type DirHandle ¶
type DirHandle struct { Marker *string // contains filtered or unexported fields }
func NewDirHandle ¶
type DirHandleEntry ¶
type DirInodeData ¶
type FileHandle ¶
type FileHandle struct { // User space PID. All threads created by a process will have the same TGID, // but different PIDs[1]. // This value can be nil if we fail to get TGID from PID[2]. // [1] : https://godoc.org/github.com/shirou/gopsutil/process#Process.Tgid // [2] : https://github.com/shirou/gopsutil#process-class Tgid *int32 // contains filtered or unexported fields }
func NewFileHandle ¶
func NewFileHandle(inode *Inode, opMetadata fuseops.OpMetadata) *FileHandle
NewFileHandle returns a new file handle for the given `inode` triggered by fuse operation with the given `opMetadata`
func (*FileHandle) FlushFile ¶
func (fh *FileHandle) FlushFile() (err error)
func (*FileHandle) ReadFile ¶
func (fh *FileHandle) ReadFile(offset int64, buf []byte) (bytesRead int, err error)
func (*FileHandle) Release ¶
func (fh *FileHandle) Release()
type FileSystem ¶
type FileSystem struct { fuseutil.NotImplementedFileSystem // contains filtered or unexported fields }
func MountFS ¶
func MountFS(ctx context.Context, cloud storage.ObjectBackend, flags *Flags) (*FileSystem, *fuse.MountedFileSystem, error)
func NewFileSystem ¶
func NewFileSystem(ctx context.Context, cloud storage.ObjectBackend, flags *Flags) *FileSystem
func (*FileSystem) CreateFile ¶
func (fs *FileSystem) CreateFile(ctx context.Context, op *fuseops.CreateFileOp) (err error)
func (*FileSystem) FlushFile ¶
func (fs *FileSystem) FlushFile(ctx context.Context, op *fuseops.FlushFileOp) (err error)
func (*FileSystem) ForgetInode ¶
func (fs *FileSystem) ForgetInode(ctx context.Context, op *fuseops.ForgetInodeOp) (err error)
func (*FileSystem) GetInodeAttributes ¶
func (fs *FileSystem) GetInodeAttributes(ctx context.Context, op *fuseops.GetInodeAttributesOp) (err error)
func (*FileSystem) GetXattr ¶
func (fs *FileSystem) GetXattr(ctx context.Context, op *fuseops.GetXattrOp) (err error)
func (*FileSystem) ListXattr ¶
func (fs *FileSystem) ListXattr(ctx context.Context, op *fuseops.ListXattrOp) (err error)
func (*FileSystem) LookUpInode ¶
func (fs *FileSystem) LookUpInode(ctx context.Context, op *fuseops.LookUpInodeOp) (err error)
func (*FileSystem) Mount ¶
func (fs *FileSystem) Mount(mount *Mount)
func (*FileSystem) MountAll ¶
func (fs *FileSystem) MountAll(mounts []*Mount)
func (*FileSystem) OpenFile ¶
func (fs *FileSystem) OpenFile(ctx context.Context, op *fuseops.OpenFileOp) (err error)
func (*FileSystem) ReadFile ¶
func (fs *FileSystem) ReadFile(ctx context.Context, op *fuseops.ReadFileOp) (err error)
func (*FileSystem) ReleaseDirHandle ¶
func (fs *FileSystem) ReleaseDirHandle(ctx context.Context, op *fuseops.ReleaseDirHandleOp) (err error)
func (*FileSystem) ReleaseFileHandle ¶
func (fs *FileSystem) ReleaseFileHandle(ctx context.Context, op *fuseops.ReleaseFileHandleOp) (err error)
func (*FileSystem) RemoveXattr ¶
func (fs *FileSystem) RemoveXattr(ctx context.Context, op *fuseops.RemoveXattrOp) (err error)
func (*FileSystem) Rename ¶
rename("from", "to") causes the kernel to send lookup of "from" and "to" prior to sending rename to us
func (*FileSystem) SetInodeAttributes ¶
func (fs *FileSystem) SetInodeAttributes(ctx context.Context, op *fuseops.SetInodeAttributesOp) (err error)
func (*FileSystem) SetXattr ¶
func (fs *FileSystem) SetXattr(ctx context.Context, op *fuseops.SetXattrOp) (err error)
func (*FileSystem) SigUsr1 ¶
func (fs *FileSystem) SigUsr1()
func (*FileSystem) SyncFile ¶
func (fs *FileSystem) SyncFile(ctx context.Context, op *fuseops.SyncFileOp) (err error)
func (*FileSystem) Unmount ¶
func (fs *FileSystem) Unmount(mountPoint string)
func (*FileSystem) WriteFile ¶
func (fs *FileSystem) WriteFile(ctx context.Context, op *fuseops.WriteFileOp) (err error)
type Flags ¶
type Flags struct { // File system MountOptions map[string]string MountPoint string MountPointArg string MountPointCreated string Cache []string DirMode os.FileMode FileMode os.FileMode Uid uint32 Gid uint32 // Common Backend Flags UseContentType bool Endpoint string // Tuning ExplicitDir bool StatCacheTTL time.Duration TypeCacheTTL time.Duration HTTPTimeout time.Duration // Debugging DebugFuse bool Foreground bool }
func (*Flags) GetMimeType ¶
type FusePanicLogger ¶
type FusePanicLogger struct {
Fs fuseutil.FileSystem
}
func (FusePanicLogger) CreateFile ¶
func (fs FusePanicLogger) CreateFile(ctx context.Context, op *fuseops.CreateFileOp) (err error)
func (FusePanicLogger) CreateLink ¶
func (fs FusePanicLogger) CreateLink(ctx context.Context, op *fuseops.CreateLinkOp) (err error)
func (FusePanicLogger) CreateSymlink ¶
func (fs FusePanicLogger) CreateSymlink(ctx context.Context, op *fuseops.CreateSymlinkOp) (err error)
func (FusePanicLogger) Destroy ¶
func (fs FusePanicLogger) Destroy()
func (FusePanicLogger) Fallocate ¶
func (fs FusePanicLogger) Fallocate(ctx context.Context, op *fuseops.FallocateOp) (err error)
func (FusePanicLogger) FlushFile ¶
func (fs FusePanicLogger) FlushFile(ctx context.Context, op *fuseops.FlushFileOp) (err error)
func (FusePanicLogger) ForgetInode ¶
func (fs FusePanicLogger) ForgetInode(ctx context.Context, op *fuseops.ForgetInodeOp) (err error)
func (FusePanicLogger) GetInodeAttributes ¶
func (fs FusePanicLogger) GetInodeAttributes(ctx context.Context, op *fuseops.GetInodeAttributesOp) (err error)
func (FusePanicLogger) GetXattr ¶
func (fs FusePanicLogger) GetXattr(ctx context.Context, op *fuseops.GetXattrOp) (err error)
func (FusePanicLogger) ListXattr ¶
func (fs FusePanicLogger) ListXattr(ctx context.Context, op *fuseops.ListXattrOp) (err error)
func (FusePanicLogger) LookUpInode ¶
func (fs FusePanicLogger) LookUpInode(ctx context.Context, op *fuseops.LookUpInodeOp) (err error)
func (FusePanicLogger) OpenFile ¶
func (fs FusePanicLogger) OpenFile(ctx context.Context, op *fuseops.OpenFileOp) (err error)
func (FusePanicLogger) ReadFile ¶
func (fs FusePanicLogger) ReadFile(ctx context.Context, op *fuseops.ReadFileOp) (err error)
func (FusePanicLogger) ReadSymlink ¶
func (fs FusePanicLogger) ReadSymlink(ctx context.Context, op *fuseops.ReadSymlinkOp) (err error)
func (FusePanicLogger) ReleaseDirHandle ¶
func (fs FusePanicLogger) ReleaseDirHandle(ctx context.Context, op *fuseops.ReleaseDirHandleOp) (err error)
func (FusePanicLogger) ReleaseFileHandle ¶
func (fs FusePanicLogger) ReleaseFileHandle(ctx context.Context, op *fuseops.ReleaseFileHandleOp) (err error)
func (FusePanicLogger) RemoveXattr ¶
func (fs FusePanicLogger) RemoveXattr(ctx context.Context, op *fuseops.RemoveXattrOp) (err error)
func (FusePanicLogger) SetInodeAttributes ¶
func (fs FusePanicLogger) SetInodeAttributes(ctx context.Context, op *fuseops.SetInodeAttributesOp) (err error)
func (FusePanicLogger) SetXattr ¶
func (fs FusePanicLogger) SetXattr(ctx context.Context, op *fuseops.SetXattrOp) (err error)
func (FusePanicLogger) SyncFile ¶
func (fs FusePanicLogger) SyncFile(ctx context.Context, op *fuseops.SyncFileOp) (err error)
func (FusePanicLogger) WriteFile ¶
func (fs FusePanicLogger) WriteFile(ctx context.Context, op *fuseops.WriteFileOp) (err error)
type Inode ¶
type Inode struct { Id fuseops.InodeID Name *string Attributes InodeAttributes KnownSize *uint64 // It is generally safe to read `AttrTime` without locking because if some other // operation is modifying `AttrTime`, in most cases the reader is okay with working with // stale data. But Time is a struct and modifying it is not atomic. However // in practice (until the year 2157) we should be okay because // - Almost all uses of AttrTime will be about comparisions (AttrTime < x, AttrTime > x) // - Time object will have Time::monotonic bit set (until the year 2157) => the time // comparision just compares Time::ext field // Ref: https://github.com/golang/go/blob/e42ae65a8507/src/time/time.go#L12:L56 AttrTime time.Time // We are not very consistent about enforcing locks for `Parent` because, the // parent field very very rarely changes and it is generally fine to operate on // stale parent informaiton Parent *Inode Invalid bool ImplicitDir bool // contains filtered or unexported fields }
func (*Inode) Create ¶
func (parent *Inode) Create(name string, metadata fuseops.OpMetadata) (inode *Inode, fh *FileHandle)
func (*Inode) GetAttributes ¶
func (inode *Inode) GetAttributes() (*fuseops.InodeAttributes, error)
func (*Inode) InflateAttributes ¶
func (inode *Inode) InflateAttributes() (attr fuseops.InodeAttributes)
func (*Inode) LookUpInodeDir ¶
func (parent *Inode) LookUpInodeDir(name string, c chan storage.ListBlobsOutput, errc chan error)
func (*Inode) LookUpInodeMaybeDir ¶
returned inode has nil Id
func (*Inode) LookUpInodeNotDir ¶
func (parent *Inode) LookUpInodeNotDir(name string, c chan storage.HeadBlobOutput, errc chan error)
func (*Inode) OpenFile ¶
func (inode *Inode) OpenFile(metadata fuseops.OpMetadata) (fh *FileHandle, err error)
func (*Inode) Ref ¶
func (inode *Inode) Ref()
LOCKS_REQUIRED(fs.mu) XXX why did I put lock required? This used to return a resurrect bool which no long does anything, need to look into that to see if that was legacy
func (*Inode) RemoveXattr ¶
func (*Inode) Rename ¶
semantic of rename: rename("any", "not_exists") = ok rename("file1", "file2") = ok rename("empty_dir1", "empty_dir2") = ok rename("nonempty_dir1", "empty_dir2") = ok rename("nonempty_dir1", "nonempty_dir2") = ENOTEMPTY rename("file", "dir") = EISDIR rename("dir", "file") = ENOTDIR
func (*Inode) ResetForUnmount ¶
func (inode *Inode) ResetForUnmount()
ResetForUnmount resets the Inode as part of unmounting a storage backend mounted at the given inode. ACQUIRES_LOCK(inode.mu)
func (*Inode) SetFromBlobItem ¶
func (inode *Inode) SetFromBlobItem(item *storage.BlobItemOutput)
type InodeAttributes ¶
func (InodeAttributes) Equal ¶
func (i InodeAttributes) Equal(other InodeAttributes) bool
type MBuf ¶
type MBuf struct {
// contains filtered or unexported fields
}
type ReadBuffer ¶
type ReadBuffer struct {
// contains filtered or unexported fields
}
func (ReadBuffer) Init ¶
func (b ReadBuffer) Init(fh *FileHandle, offset uint64, size uint32) *ReadBuffer
type ReaderProvider ¶
type ReaderProvider func() (io.ReadCloser, error)