fs

package
v2.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBlksize    = uint32(1) << 12
	DefaultMaxNameLen = uint32(256)
)
View Source
const (
	DefaultInodeExpiration = 120 * time.Second
	MaxInodeCache          = 10000000 // in terms of the number of items
)
View Source
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
)
View Source
const (
	DeleteExtentsTimeout = 600 * time.Second
)
View Source
const (
	// the expiration duration of the dentry in the cache (used internally)
	DentryValidDuration = 5 * time.Second
)
View Source
const (
	LogTimeFormat = "20060102150405000"
)
View Source
const (
	RootInode = proto.RootIno
)

Variables

View Source
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

func ParseError

func ParseError(err error) syscall.Errno

ParseError returns the error type.

func ParseType

func ParseType(t uint32) fuseutil.DirentType

ParseType returns the dentry type.

Types

type DentryCache added in v1.4.0

type DentryCache struct {
	sync.Mutex
	// contains filtered or unexported fields
}

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 Handle

type Handle struct {
	// contains filtered or unexported fields
}

type HandleCache

type HandleCache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewHandleCache

func NewHandleCache() *HandleCache

func (*HandleCache) Assign

func (hc *HandleCache) Assign(ino uint64) fuseops.HandleID

func (*HandleCache) Get

func (hc *HandleCache) Get(hid fuseops.HandleID) *Handle

func (*HandleCache) Release

func (hc *HandleCache) Release(hid fuseops.HandleID) *Handle

type Inode

type Inode struct {
	// contains filtered or unexported fields
}

Inode defines the structure of an inode.

func NewInode

func NewInode(info *proto.InodeInfo) *Inode

NewInode returns a new inode.

func (*Inode) String

func (inode *Inode) String() string

String returns the string format of the inode.

type InodeCache

type InodeCache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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

type OrphanInodeList struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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 NewSuper

func NewSuper(opt *proto.MountOptions) (s *Super, err error)

func (*Super) ClusterName

func (s *Super) ClusterName() string

func (*Super) CreateFile

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 (*Super) Destroy

func (s *Super) Destroy()

func (*Super) FlushFile

func (s *Super) FlushFile(ctx context.Context, op *fuseops.FlushFileOp) error

func (*Super) ForgetInode

func (s *Super) ForgetInode(ctx context.Context, op *fuseops.ForgetInodeOp) error

func (*Super) GetInodeAttributes

func (s *Super) GetInodeAttributes(ctx context.Context, op *fuseops.GetInodeAttributesOp) error

func (*Super) GetRate added in v1.4.0

func (s *Super) GetRate(w http.ResponseWriter, r *http.Request)

func (*Super) GetXattr

func (s *Super) GetXattr(ctx context.Context, op *fuseops.GetXattrOp) error

func (*Super) InodeGet

func (s *Super) InodeGet(ino uint64) (*Inode, error)

InodeGet return the inode based on the given inode ID.

func (*Super) ListXattr

func (s *Super) ListXattr(ctx context.Context, op *fuseops.ListXattrOp) error

func (*Super) LookUpInode

func (s *Super) LookUpInode(ctx context.Context, op *fuseops.LookUpInodeOp) error

func (*Super) MkDir

func (s *Super) MkDir(ctx context.Context, op *fuseops.MkDirOp) error

func (*Super) MkNode

func (s *Super) MkNode(ctx context.Context, op *fuseops.MkNodeOp) error

func (*Super) OpenDir

func (s *Super) OpenDir(ctx context.Context, op *fuseops.OpenDirOp) error

func (*Super) OpenFile

func (s *Super) OpenFile(ctx context.Context, op *fuseops.OpenFileOp) error

func (*Super) ReadDir

func (s *Super) ReadDir(ctx context.Context, op *fuseops.ReadDirOp) error

func (*Super) ReadFile

func (s *Super) ReadFile(ctx context.Context, op *fuseops.ReadFileOp) error
func (s *Super) ReadSymlink(ctx context.Context, op *fuseops.ReadSymlinkOp) error

func (*Super) ReleaseDirHandle

func (s *Super) ReleaseDirHandle(ctx context.Context, op *fuseops.ReleaseDirHandleOp) error

func (*Super) ReleaseFileHandle

func (s *Super) ReleaseFileHandle(ctx context.Context, op *fuseops.ReleaseFileHandleOp) error

func (*Super) RemoveXattr

func (s *Super) RemoveXattr(ctx context.Context, op *fuseops.RemoveXattrOp) error

func (*Super) Rename

func (s *Super) Rename(ctx context.Context, op *fuseops.RenameOp) error

func (*Super) RmDir

func (s *Super) RmDir(ctx context.Context, op *fuseops.RmDirOp) error

func (*Super) SetInodeAttributes

func (s *Super) SetInodeAttributes(ctx context.Context, op *fuseops.SetInodeAttributesOp) error

func (*Super) SetRate added in v1.4.0

func (s *Super) SetRate(w http.ResponseWriter, r *http.Request)

func (*Super) SetXattr

func (s *Super) SetXattr(ctx context.Context, op *fuseops.SetXattrOp) error

func (*Super) StatFS

func (s *Super) StatFS(ctx context.Context, op *fuseops.StatFSOp) error

func (*Super) SyncFile

func (s *Super) SyncFile(ctx context.Context, op *fuseops.SyncFileOp) error

func (*Super) TokenType

func (s *Super) TokenType() int8
func (s *Super) Unlink(ctx context.Context, op *fuseops.UnlinkOp) error

func (*Super) WriteFile

func (s *Super) WriteFile(ctx context.Context, op *fuseops.WriteFileOp) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL