Documentation ¶
Overview ¶
Package node implements the FUSE filesystem
Index ¶
- Constants
- type DinoNode
- func (node *DinoNode) Create(ctx context.Context, name string, flags uint32, mode uint32, ...) (*fs.Inode, fs.FileHandle, uint32, syscall.Errno)
- func (node *DinoNode) Flush(ctx context.Context, f fs.FileHandle) syscall.Errno
- func (node *DinoNode) Fsync(ctx context.Context, f fs.FileHandle, flags uint32) syscall.Errno
- func (node *DinoNode) Getattr(ctx context.Context, f fs.FileHandle, out *fuse.AttrOut) syscall.Errno
- func (node *DinoNode) Getxattr(ctx context.Context, attr string, dest []byte) (uint32, syscall.Errno)
- func (node *DinoNode) LoadMetadata(key [NodeKeyLen]byte) error
- func (node *DinoNode) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
- func (node *DinoNode) Mkdir(ctx context.Context, name string, mode uint32, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
- func (node *DinoNode) Open(ctx context.Context, flags uint32) (fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno)
- func (node *DinoNode) Opendir(ctx context.Context) syscall.Errno
- func (node *DinoNode) Read(ctx context.Context, f fs.FileHandle, dest []byte, off int64) (fuse.ReadResult, syscall.Errno)
- func (node *DinoNode) Readlink(ctx context.Context) ([]byte, syscall.Errno)
- func (node *DinoNode) Release(ctx context.Context, f fs.FileHandle) syscall.Errno
- func (node *DinoNode) Rename(ctx context.Context, name string, newParent fs.InodeEmbedder, newName string, ...) syscall.Errno
- func (node *DinoNode) Rmdir(ctx context.Context, name string) syscall.Errno
- func (node *DinoNode) Setattr(ctx context.Context, f fs.FileHandle, in *fuse.SetAttrIn, out *fuse.AttrOut) syscall.Errno
- func (node *DinoNode) Setxattr(ctx context.Context, attr string, data []byte, flags uint32) syscall.Errno
- func (node *DinoNode) Statfs(ctx context.Context, out *fuse.StatfsOut) syscall.Errno
- func (node *DinoNode) Symlink(ctx context.Context, target, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
- func (node *DinoNode) Unlink(ctx context.Context, name string) syscall.Errno
- func (node *DinoNode) Write(ctx context.Context, f fs.FileHandle, data []byte, off int64) (written uint32, errno syscall.Errno)
- type DinoNodeFactory
- type InodeNumbersGenerator
Constants ¶
const ( // NodeKeyLen is the default node key length NodeKeyLen int = 20 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DinoNode ¶
type DinoNode struct { fs.Inode User uint32 Group uint32 Mode uint32 Time time.Time // Used as the Key to save/retrieve this node in the metadata store. It's a // sort of inode number, but it's not assigned by a central entity and can't // be reused. Key [NodeKeyLen]byte // Only makes sense for directories: Children map[string]*DinoNode // contains filtered or unexported fields }
DinoNode holds information about a filesystem node and implements the FUSE filesystem interface
func (*DinoNode) Create ¶
func (node *DinoNode) Create(ctx context.Context, name string, flags uint32, mode uint32, out *fuse.EntryOut) (*fs.Inode, fs.FileHandle, uint32, syscall.Errno)
Create ...
func (*DinoNode) Getattr ¶
func (node *DinoNode) Getattr(ctx context.Context, f fs.FileHandle, out *fuse.AttrOut) syscall.Errno
Getattr ...
func (*DinoNode) Getxattr ¶
func (node *DinoNode) Getxattr(ctx context.Context, attr string, dest []byte) (uint32, syscall.Errno)
Getxattr should read data for the given attribute into `dest` and return the number of bytes. If `dest` is too small, it should return ERANGE and the size of the attribute. If not defined, Getxattr will return ENOATTR.
func (*DinoNode) LoadMetadata ¶
func (node *DinoNode) LoadMetadata(key [NodeKeyLen]byte) error
LoadMetadata loads metadata for a node
func (*DinoNode) Lookup ¶
func (node *DinoNode) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
Lookup ...
func (*DinoNode) Mkdir ¶
func (node *DinoNode) Mkdir(ctx context.Context, name string, mode uint32, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
Mkdir ...
func (*DinoNode) Open ¶
func (node *DinoNode) Open(ctx context.Context, flags uint32) (fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno)
Open ...
func (*DinoNode) Rename ¶
func (node *DinoNode) Rename(ctx context.Context, name string, newParent fs.InodeEmbedder, newName string, flags uint32) syscall.Errno
Rename ...
func (*DinoNode) Setattr ¶
func (node *DinoNode) Setattr(ctx context.Context, f fs.FileHandle, in *fuse.SetAttrIn, out *fuse.AttrOut) syscall.Errno
Setattr ...
func (*DinoNode) Setxattr ¶
func (node *DinoNode) Setxattr(ctx context.Context, attr string, data []byte, flags uint32) syscall.Errno
Setxattr ...
func (*DinoNode) Symlink ¶
func (node *DinoNode) Symlink(ctx context.Context, target, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
Symlink ...
type DinoNodeFactory ¶
type DinoNodeFactory struct { Root *DinoNode InodeGenerator *InodeNumbersGenerator Metadata storage.VersionedStore Blobs *storage.BlobStoreWrapper // contains filtered or unexported fields }
DinoNodeFactory creates filesystem nodes
func (*DinoNodeFactory) ExistingNode ¶
func (factory *DinoNodeFactory) ExistingNode(name string, key [NodeKeyLen]byte) *DinoNode
ExistingNode adds a new node
func (*DinoNodeFactory) InvalidateCache ¶
func (factory *DinoNodeFactory) InvalidateCache(mutation message.Message)
InvalidateCache invalidates a cached node
type InodeNumbersGenerator ¶
type InodeNumbersGenerator struct {
// contains filtered or unexported fields
}
InodeNumbersGenerator generates inode numbers starting from 2 (1 is reserved for the root node)
func NewInodeNumbersGenerator ¶
func NewInodeNumbersGenerator() *InodeNumbersGenerator
NewInodeNumbersGenerator creates a new inode generator
func (*InodeNumbersGenerator) Next ¶
func (g *InodeNumbersGenerator) Next() uint64
Next returns the next generated inode
func (*InodeNumbersGenerator) Start ¶
func (g *InodeNumbersGenerator) Start()
Start starts the generator
func (*InodeNumbersGenerator) Stop ¶
func (g *InodeNumbersGenerator) Stop()
Stop stops the generator