Documentation ¶
Index ¶
- Constants
- Variables
- func ParseError(err error) syscall.Errno
- func ParseType(t uint32) fuseutil.DirentType
- type DentryCache
- type Handle
- type HandleCache
- type Inode
- type InodeCache
- type OrphanInodeList
- type Super
- func (s *Super) ClusterName() string
- func (s *Super) CreateFile(ctx context.Context, op *fuseops.CreateFileOp) error
- func (s *Super) CreateLink(ctx context.Context, op *fuseops.CreateLinkOp) error
- func (s *Super) CreateSymlink(ctx context.Context, op *fuseops.CreateSymlinkOp) error
- func (s *Super) Destroy()
- func (s *Super) FlushFile(ctx context.Context, op *fuseops.FlushFileOp) error
- func (s *Super) ForgetInode(ctx context.Context, op *fuseops.ForgetInodeOp) error
- func (s *Super) GetInodeAttributes(ctx context.Context, op *fuseops.GetInodeAttributesOp) error
- func (s *Super) GetRate(w http.ResponseWriter, r *http.Request)
- func (s *Super) GetXattr(ctx context.Context, op *fuseops.GetXattrOp) error
- func (s *Super) InodeGet(ino uint64) (*Inode, error)
- func (s *Super) ListXattr(ctx context.Context, op *fuseops.ListXattrOp) error
- func (s *Super) LookUpInode(ctx context.Context, op *fuseops.LookUpInodeOp) error
- func (s *Super) MkDir(ctx context.Context, op *fuseops.MkDirOp) error
- func (s *Super) MkNode(ctx context.Context, op *fuseops.MkNodeOp) error
- func (s *Super) OpenDir(ctx context.Context, op *fuseops.OpenDirOp) error
- func (s *Super) OpenFile(ctx context.Context, op *fuseops.OpenFileOp) error
- func (s *Super) ReadDir(ctx context.Context, op *fuseops.ReadDirOp) error
- func (s *Super) ReadFile(ctx context.Context, op *fuseops.ReadFileOp) error
- func (s *Super) ReadSymlink(ctx context.Context, op *fuseops.ReadSymlinkOp) error
- func (s *Super) ReleaseDirHandle(ctx context.Context, op *fuseops.ReleaseDirHandleOp) error
- func (s *Super) ReleaseFileHandle(ctx context.Context, op *fuseops.ReleaseFileHandleOp) error
- func (s *Super) RemoveXattr(ctx context.Context, op *fuseops.RemoveXattrOp) error
- func (s *Super) Rename(ctx context.Context, op *fuseops.RenameOp) error
- func (s *Super) RmDir(ctx context.Context, op *fuseops.RmDirOp) error
- func (s *Super) SetInodeAttributes(ctx context.Context, op *fuseops.SetInodeAttributesOp) error
- func (s *Super) SetRate(w http.ResponseWriter, r *http.Request)
- func (s *Super) SetXattr(ctx context.Context, op *fuseops.SetXattrOp) error
- func (s *Super) StatFS(ctx context.Context, op *fuseops.StatFSOp) error
- func (s *Super) SyncFile(ctx context.Context, op *fuseops.SyncFileOp) error
- func (s *Super) TokenType() int8
- func (s *Super) Unlink(ctx context.Context, op *fuseops.UnlinkOp) error
- func (s *Super) WriteFile(ctx context.Context, op *fuseops.WriteFileOp) error
Constants ¶
const ( DefaultBlksize = uint32(1) << 12 DefaultMaxNameLen = uint32(256) )
const ( DefaultInodeExpiration = 120 * time.Second MaxInodeCache = 10000000 // in terms of the number of items )
const ( // MinInodeCacheEvictNum is used in the foreground eviction. // When clearing the inodes from the cache, it stops as soon as 10 inodes have been evicted. MinInodeCacheEvictNum = 10 // MaxInodeCacheEvictNum is used in the back ground. We can evict 200000 inodes at max. MaxInodeCacheEvictNum = 200000 BgEvictionInterval = 2 * time.Minute )
const (
DeleteExtentsTimeout = 600 * time.Second
)
const ( // the expiration duration of the dentry in the cache (used internally) DentryValidDuration = 5 * time.Second )
const (
LogTimeFormat = "20060102150405000"
)
const (
RootInode = proto.RootIno
)
Variables ¶
var ( // The following two are used in the FUSE cache // every time the lookup will be performed on the fly, and the result will not be cached LookupValidDuration = 5 * time.Second // the expiration duration of the attributes in the FUSE cache AttrValidDuration = 30 * time.Second )
Functions ¶
Types ¶
type DentryCache ¶ added in v1.4.0
DentryCache defines the dentry cache.
func NewDentryCache ¶ added in v1.4.0
func NewDentryCache() *DentryCache
NewDentryCache returns a new dentry cache.
func (*DentryCache) Delete ¶ added in v1.4.0
func (dc *DentryCache) Delete(name string)
Delete deletes the item based on the given key.
func (*DentryCache) Get ¶ added in v1.4.0
func (dc *DentryCache) Get(name string) (uint64, bool)
Get gets the item from the cache based on the given key.
func (*DentryCache) Put ¶ added in v1.4.0
func (dc *DentryCache) Put(name string, ino uint64)
Put puts an item into the cache.
type HandleCache ¶
func NewHandleCache ¶
func NewHandleCache() *HandleCache
type Inode ¶
type Inode struct {
// contains filtered or unexported fields
}
Inode defines the structure of an inode.
type InodeCache ¶
InodeCache defines the structure of the inode cache.
func NewInodeCache ¶
func NewInodeCache(exp time.Duration, maxElements int) *InodeCache
NewInodeCache returns a new inode cache.
func (*InodeCache) Delete ¶
func (ic *InodeCache) Delete(ino uint64)
Delete deletes the inode based on the given inode ID.
func (*InodeCache) Get ¶
func (ic *InodeCache) Get(ino uint64) *Inode
Get returns the inode based on the given inode ID.
func (*InodeCache) Put ¶
func (ic *InodeCache) Put(inode *Inode)
Put puts the given inode into the inode cache.
type OrphanInodeList ¶
OrphanInodeList defines the orphan inode list, which is a list of orphan inodes. An orphan inode is the inode whose nlink value is 0.
func NewOrphanInodeList ¶
func NewOrphanInodeList() *OrphanInodeList
NewOrphanInodeList returns a new orphan inode list.
func (*OrphanInodeList) Evict ¶
func (l *OrphanInodeList) Evict(ino uint64) bool
Evict remove the given inode from the orphan inode list, and evicts it.
func (*OrphanInodeList) Put ¶
func (l *OrphanInodeList) Put(ino uint64)
Put puts an inode into the orphan inode list.
type Super ¶
type Super struct {
// contains filtered or unexported fields
}
func (*Super) ClusterName ¶
func (*Super) CreateFile ¶
func (*Super) CreateLink ¶
func (*Super) CreateSymlink ¶
func (*Super) ForgetInode ¶
func (*Super) GetInodeAttributes ¶
func (*Super) GetRate ¶ added in v1.4.0
func (s *Super) GetRate(w http.ResponseWriter, r *http.Request)
func (*Super) LookUpInode ¶
func (*Super) ReadSymlink ¶
func (*Super) ReleaseDirHandle ¶
func (*Super) ReleaseFileHandle ¶
func (*Super) RemoveXattr ¶
func (*Super) SetInodeAttributes ¶
func (*Super) SetRate ¶ added in v1.4.0
func (s *Super) SetRate(w http.ResponseWriter, r *http.Request)