Commit 1bebc90a authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Add some more comments.

parent a8c70d06
...@@ -26,11 +26,17 @@ type NodeFileSystem interface { ...@@ -26,11 +26,17 @@ type NodeFileSystem interface {
String() string String() string
} }
// The FsNode implements the basic functionality of inodes; this is
// where the majority of the FS code for a typical filesystem will be.
type FsNode interface { type FsNode interface {
// The following are called by the FileSystemConnector // Inode and SetInode are basic getter/setters. They are
// called by the FileSystemConnector. You get them for free by
// embedding DefaultFsNode.
Inode() *Inode Inode() *Inode
SetInode(node *Inode) SetInode(node *Inode)
// Lookup finds a child node to this node; it is only called
// for directory FsNodes.
Lookup(out *Attr, name string, context *Context) (node FsNode, code Status) Lookup(out *Attr, name string, context *Context) (node FsNode, code Status)
// Deletable() should return true if this inode may be // Deletable() should return true if this inode may be
...@@ -47,7 +53,7 @@ type FsNode interface { ...@@ -47,7 +53,7 @@ type FsNode interface {
Access(mode uint32, context *Context) (code Status) Access(mode uint32, context *Context) (code Status)
Readlink(c *Context) ([]byte, Status) Readlink(c *Context) ([]byte, Status)
// Namespace operations // Namespace operations; these are only called on directory FsNodes.
Mknod(name string, mode uint32, dev uint32, context *Context) (newNode FsNode, code Status) Mknod(name string, mode uint32, dev uint32, context *Context) (newNode FsNode, code Status)
Mkdir(name string, mode uint32, context *Context) (newNode FsNode, code Status) Mkdir(name string, mode uint32, context *Context) (newNode FsNode, code Status)
Unlink(name string, context *Context) (code Status) Unlink(name string, context *Context) (code Status)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment