Documentation ¶
Index ¶
- Constants
- func CopySomeAttr(src, dst *Attr)
- func GetFiletype(mode uint16) uint8
- func SetTime(time *uint64, timensec *uint32, t time.Time)
- func ToAttrOut(ino Ino, attr *Attr, out *fuse.Attr)
- func TypeToStatType(_type uint8) uint32
- type Attr
- type ChunkAttr
- type Dentry
- type DentryData
- type DirStream
- type Ino
- type RedisMeta
- func (r *RedisMeta) CurInodeCount(ctx context.Context) (uint64, error)
- func (r *RedisMeta) DelDentry(ctx context.Context, parent Ino, name string) error
- func (r *RedisMeta) DeleteChunkMeta(ctx context.Context, inode Ino, pageNum int64) error
- func (r *RedisMeta) GetAllDentries(ctx context.Context, ino Ino) ([]*Dentry, error)
- func (r *RedisMeta) GetChunkMeta(ctx context.Context, inode Ino, pageNum int64) (*ChunkAttr, bool, error)
- func (r *RedisMeta) GetDentry(ctx context.Context, parent Ino, name string) (*Dentry, bool, error)
- func (r *RedisMeta) GetDirectoryLength(ctx context.Context, ino Ino) (int64, error)
- func (r *RedisMeta) Getattr(ctx context.Context, ino Ino) (*Attr, syscall.Errno)
- func (r *RedisMeta) Init(ctx context.Context) error
- func (r *RedisMeta) Link(ctx context.Context, parent Ino, target Ino, name string) (*Attr, syscall.Errno)
- func (r *RedisMeta) MkNod(ctx context.Context, parent Ino, _type uint8, name string, mode uint32, ...) (*Attr, Ino, syscall.Errno)
- func (r *RedisMeta) Ref(ctx context.Context, inode Ino) syscall.Errno
- func (r *RedisMeta) RefDel(ctx context.Context, inode Ino) error
- func (r *RedisMeta) RefGet(ctx context.Context, inode Ino) (string, error)
- func (r *RedisMeta) RefSet(ctx context.Context, inode Ino, value string) error
- func (r *RedisMeta) Rename(ctx context.Context, parent Ino, oldName string, newParent Ino, newName string) syscall.Errno
- func (r *RedisMeta) Rmdir(ctx context.Context, parent Ino, name string) syscall.Errno
- func (r *RedisMeta) SetChunkMeta(ctx context.Context, inode Ino, pageNum int64, offset int64, lens int, ...) error
- func (r *RedisMeta) SetDentry(ctx context.Context, parent Ino, name string, inode Ino, typ uint8) error
- func (r *RedisMeta) SetTotalInodeCount(ctx context.Context, totalInodeCount uint64) error
- func (r *RedisMeta) SetTotalSpace(ctx context.Context, totalSpace uint64) error
- func (r *RedisMeta) SetattrDirectly(ctx context.Context, ino Ino, attr *Attr) error
- func (r *RedisMeta) TotalInodeCount(ctx context.Context) (uint64, error)
- func (r *RedisMeta) TotalSpace(ctx context.Context) (uint64, error)
- func (r *RedisMeta) TruncateChunkMeta(ctx context.Context, inode Ino, lastPageNum int64, lastPageLength int) error
- func (r *RedisMeta) Unlink(ctx context.Context, parent Ino, name string) syscall.Errno
- func (r *RedisMeta) UpdateUsedSpace(ctx context.Context, size int64) error
- func (r *RedisMeta) UsedSpace(ctx context.Context) (uint64, error)
Constants ¶
View Source
const ( TypeFile = 1 // type for regular file TypeDirectory = 2 // type for directory TypeSymlink = 3 // type for symlink TypeFIFO = 4 // type for FIFO node TypeBlockDev = 5 // type for block device TypeCharDev = 6 // type for character device TypeSocket = 7 // type for socket )
View Source
const CurInode = "nextinode"
View Source
const TotalInode = "totalinode"
View Source
const TotalSpace = "totalspace"
View Source
const UsedSpace = "usedspace"
Variables ¶
This section is empty.
Functions ¶
func CopySomeAttr ¶
func CopySomeAttr(src, dst *Attr)
func GetFiletype ¶
func TypeToStatType ¶
Types ¶
type Attr ¶
type Attr struct { Flags uint8 `json:"flags,omitempty"` // reserved flags Typ uint8 `json:"type,omitempty"` // type of a node Mode uint16 `json:"mode,omitempty"` // permission mode Uid uint32 `json:"uid,omitempty"` // owner id Gid uint32 `json:"gid,omitempty"` // group id of owner Atime uint64 `json:"atime,omitempty"` // last access time Mtime uint64 `json:"mtime,omitempty"` // last modified time Ctime uint64 `json:"ctime,omitempty"` // last change time for meta Atimensec uint32 `json:"atimensec,omitempty"` // nanosecond part of atime Mtimensec uint32 `json:"mtimensec,omitempty"` // nanosecond part of mtime Ctimensec uint32 `json:"ctimensec,omitempty"` // nanosecond part of ctime Nlink uint32 `json:"nlink,omitempty"` // number of links (sub-directories or hardlinks) Length uint64 `json:"length,omitempty"` // length of regular file Rdev uint32 `json:"rdev,omitempty"` // device number }
Attr is inode attributes information
type Dentry ¶
type Dentry struct { DentryData // contains filtered or unexported fields }
type DentryData ¶
type DirStream ¶
type DirStream struct {
// contains filtered or unexported fields
}
func NewDirStream ¶
type RedisMeta ¶
type RedisMeta struct {
// contains filtered or unexported fields
}
func NewRedisMeta ¶
NewRedisMeta create a new meta instenance
func (*RedisMeta) CurInodeCount ¶
func (*RedisMeta) DeleteChunkMeta ¶
func (*RedisMeta) GetAllDentries ¶
GetAllDentries return all dentries of the directory with specified inode
func (*RedisMeta) GetChunkMeta ¶
func (*RedisMeta) GetDentry ¶
GetDentry check if directory parent have a dentry with the name, if have, return the dentry
func (*RedisMeta) GetDirectoryLength ¶
GetDirectoryLength get the dentries' number of the directory with specified inode
func (*RedisMeta) MkNod ¶
func (r *RedisMeta) MkNod(ctx context.Context, parent Ino, _type uint8, name string, mode uint32, dev uint32) (*Attr, Ino, syscall.Errno)
MkNod create a new inode
func (*RedisMeta) SetChunkMeta ¶
func (r *RedisMeta) SetChunkMeta(ctx context.Context, inode Ino, pageNum int64, offset int64, lens int, storagePath string) error
SetChunkMeta inode[pagenum] -> { offset. length, storagePath }
func (*RedisMeta) SetTotalInodeCount ¶
func (*RedisMeta) SetTotalSpace ¶
func (*RedisMeta) SetattrDirectly ¶
func (*RedisMeta) TotalInodeCount ¶
func (*RedisMeta) TruncateChunkMeta ¶
func (*RedisMeta) UpdateUsedSpace ¶
Click to show internal directories.
Click to hide internal directories.