Documentation ¶
Index ¶
- Constants
- Variables
- func GetInternalNodeByName(name string) (Ino, *Attr)
- func IsSpecialName(name string) bool
- func IsSpecialNode(ino Ino) bool
- type Attr
- type Config
- type DataReader
- type DataWriter
- type FileReader
- type FileWriter
- type Ino
- type Option
- type Owner
- type VFS
- func (v *VFS) Access(ctx *meta.Context, ino Ino, mask uint32) (err syscall.Errno)
- func (v *VFS) CopyFileRange(ctx *meta.Context, nodeIn Ino, fhIn, offIn uint64, nodeOut Ino, ...) (copied uint64, err syscall.Errno)
- func (v *VFS) Create(ctx *meta.Context, parent Ino, name string, mode uint32, cumask uint16, ...) (entry *meta.Entry, fh uint64, err syscall.Errno)
- func (v *VFS) Fallocate(ctx *meta.Context, ino Ino, mode uint8, off, length int64, fh uint64) syscall.Errno
- func (v *VFS) Flush(ctx *meta.Context, ino Ino, fh uint64, lockOwner uint64) (err syscall.Errno)
- func (v *VFS) Fsync(ctx *meta.Context, ino Ino, datasync int, fh uint64) (err syscall.Errno)
- func (v *VFS) GetAttr(ctx *meta.Context, ino Ino) (entry *meta.Entry, err syscall.Errno)
- func (v *VFS) GetLk(ctx *meta.Context, ino Ino, fh uint64, owner uint64, start, len *uint64, ...) (err syscall.Errno)
- func (v *VFS) GetXAttr(ctx *meta.Context, ino Ino, name string, size uint32) (data []byte, err syscall.Errno)
- func (v *VFS) Link(ctx *meta.Context, ino Ino, newparent Ino, newname string) (entry *meta.Entry, err syscall.Errno)
- func (v *VFS) ListXAttr(ctx *meta.Context, ino Ino, size uint32) (data []byte, err syscall.Errno)
- func (v *VFS) Lookup(ctx *meta.Context, parent Ino, name string) (entry *meta.Entry, err syscall.Errno)
- func (v *VFS) Mkdir(ctx *meta.Context, parent Ino, name string, mode uint32, cumask uint16) (entry *meta.Entry, err syscall.Errno)
- func (v *VFS) Mknod(ctx *meta.Context, parent Ino, name string, mode uint32, rdev uint32) (entry *meta.Entry, err syscall.Errno)
- func (v *VFS) Open(ctx *meta.Context, ino Ino, flags uint32) (entry *meta.Entry, fh uint64, err syscall.Errno)
- func (v *VFS) OpenDir(ctx *meta.Context, ino Ino) (fh uint64, err syscall.Errno)
- func (v *VFS) Read(ctx *meta.Context, ino Ino, buf []byte, off uint64, fh uint64) (n int, err syscall.Errno)
- func (v *VFS) ReadDir(ctx *meta.Context, ino Ino, fh uint64, offset uint64) (entries []*meta.Entry, err syscall.Errno)
- func (v *VFS) Readlink(ctx *meta.Context, ino Ino) (path []byte, err syscall.Errno)
- func (v *VFS) Release(ctx *meta.Context, ino Ino, fh uint64)
- func (v *VFS) ReleaseDir(ctx *meta.Context, ino Ino, fh uint64)
- func (v *VFS) RemoveXAttr(ctx *meta.Context, ino Ino, name string) (err syscall.Errno)
- func (v *VFS) Rename(ctx *meta.Context, parent Ino, name string, newparent Ino, newname string, ...) (err syscall.Errno)
- func (v *VFS) Rmdir(ctx *meta.Context, parent Ino, name string) (err syscall.Errno)
- func (v *VFS) SetAttr(ctx *meta.Context, ino Ino, set, mode, uid, gid uint32, atime, mtime int64, ...) (entry *meta.Entry, err syscall.Errno)
- func (v *VFS) SetLk(ctx *meta.Context, ino Ino, fh uint64, owner uint64, start, end uint64, ...) (err syscall.Errno)
- func (v *VFS) SetLkw(ctx *meta.Context, ino Ino, fh uint64, owner uint64, start, end uint64, ...) (err syscall.Errno)
- func (v *VFS) SetXAttr(ctx *meta.Context, ino Ino, name string, value []byte, flags uint32) (err syscall.Errno)
- func (v *VFS) StatFs(ctx *meta.Context) (*base.StatfsOut, syscall.Errno)
- func (v *VFS) Symlink(ctx *meta.Context, path string, parent Ino, name string) (entry *meta.Entry, err syscall.Errno)
- func (v *VFS) Truncate(ctx *meta.Context, ino Ino, size, fh uint64) (err syscall.Errno)
- func (v *VFS) Unlink(ctx *meta.Context, parent Ino, name string) (err syscall.Errno)
- func (v *VFS) Write(ctx *meta.Context, ino Ino, buf []byte, off, fh uint64) (err syscall.Errno)
Constants ¶
const READAHEAD_CHUNK = uint32(20 * 1024 * 1024)
Variables ¶
var StatsSize = 1000
Functions ¶
func GetInternalNodeByName ¶
func IsSpecialName ¶
func IsSpecialNode ¶
Types ¶
type Config ¶
type Config struct { Cache *cache.Config Meta *meta.Config // contains filtered or unexported fields }
func InitConfig ¶
type DataReader ¶
type DataReader interface {
Open(inode Ino, length uint64, ufs ufslib.UnderFileStorage, path string) (FileReader, error)
}
func NewDataReader ¶
type DataWriter ¶
type DataWriter interface {
Open(inode Ino, length uint64, ufs ufslib.UnderFileStorage, path string) (FileWriter, error)
}
func NewDataWriter ¶
type FileReader ¶
type FileWriter ¶
type VFS ¶
func (*VFS) CopyFileRange ¶
func (*VFS) Create ¶
func (v *VFS) Create(ctx *meta.Context, parent Ino, name string, mode uint32, cumask uint16, flags uint32) (entry *meta.Entry, fh uint64, err syscall.Errno)
File handling.
func (*VFS) GetLk ¶
func (v *VFS) GetLk(ctx *meta.Context, ino Ino, fh uint64, owner uint64, start, len *uint64, typ *uint32, pid *uint32) (err syscall.Errno)
File locking
func (*VFS) GetXAttr ¶
func (v *VFS) GetXAttr(ctx *meta.Context, ino Ino, name string, size uint32) (data []byte, err syscall.Errno)
GetXAttr reads an extended attribute, and should return the number of bytes. If the buffer is too small, return ERANGE, with the required buffer size.
func (*VFS) ListXAttr ¶
ListXAttr lists extended attributes as '\0' delimited byte slice, and return the number of bytes. If the buffer is too small, return ERANGE, with the required buffer size.
func (*VFS) Lookup ¶
func (v *VFS) Lookup(ctx *meta.Context, parent Ino, name string) (entry *meta.Entry, err syscall.Errno)
Lookup is called by the kernel when the VFS wants to know about a file inside a directory. Many lookup calls can occur in parallel, but only one call happens for each (dir, path) pair.
func (*VFS) Mknod ¶
func (v *VFS) Mknod(ctx *meta.Context, parent Ino, name string, mode uint32, rdev uint32) (entry *meta.Entry, err syscall.Errno)
Modifying structure.
func (*VFS) RemoveXAttr ¶
RemoveXAttr removes an extended attribute.
func (*VFS) Rename ¶
func (v *VFS) Rename(ctx *meta.Context, parent Ino, name string, newparent Ino, newname string, flags uint32) (err syscall.Errno)
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 (*VFS) SetXAttr ¶
func (v *VFS) SetXAttr(ctx *meta.Context, ino Ino, name string, value []byte, flags uint32) (err syscall.Errno)
SetAttr writes an extended attribute.