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

nodefs: rename DefaultOperations to OperationStubs

parent 0c3074f5
......@@ -53,10 +53,4 @@ Decisions
To decide
=========
* A better name for DefaultOperations.
* InodeLink
* ReadonlyOperations
* BaseOperations
* implement remaining file types (exercise Mknod)
......@@ -65,7 +65,7 @@ import (
)
// Operations is the interface that implements the filesystem inode.
// Each Operations instance must embed DefaultNode. All error
// Each Operations instance must embed OperationStubs. All error
// reporting must use the syscall.Errno type. The value 0 (`OK`)
// should be used to indicate success.
type Operations interface {
......@@ -79,12 +79,11 @@ type Operations interface {
// Inode returns the *Inode associated with this Operations
// instance. The identity of the Inode does not change over
// the lifetime of the node object. Inode() is provided by
// DefaultOperations, and should not be reimplemented.
// OperationStubs, and should not be reimplemented.
Inode() *Inode
// StatFs implements statistics for the filesystem that holds
// this Inode. DefaultNode implements this, because OSX
// filesystem must have a valid StatFs implementation.
// this Inode.
StatFs(ctx context.Context, out *fuse.StatfsOut) syscall.Errno
// Access should return if the caller can access the file with
......
......@@ -19,7 +19,7 @@ import (
)
type keepCacheFile struct {
DefaultOperations
OperationStubs
keepCache bool
mu sync.Mutex
......@@ -62,7 +62,7 @@ func (f *keepCacheFile) Read(ctx context.Context, fh FileHandle, dest []byte, of
}
type keepCacheRoot struct {
DefaultOperations
OperationStubs
keep, nokeep *keepCacheFile
}
......
This diff is collapsed.
......@@ -17,7 +17,7 @@ import (
)
type dioRoot struct {
DefaultOperations
OperationStubs
}
func (r *dioRoot) OnAdd(ctx context.Context) {
......@@ -27,7 +27,7 @@ func (r *dioRoot) OnAdd(ctx context.Context) {
// A file handle that pretends that every hole/data starts at
// multiples of 1024
type dioFH struct {
DefaultFileHandle
FileHandleStubs
}
func (f *dioFH) Lseek(ctx context.Context, off uint64, whence uint32) (uint64, syscall.Errno) {
......@@ -42,7 +42,7 @@ func (fh *dioFH) Read(ctx context.Context, data []byte, off int64) (fuse.ReadRes
// overrides Open so it can return a dioFH file handle
type dioFile struct {
DefaultOperations
OperationStubs
}
func (f *dioFile) Open(ctx context.Context, flags uint32) (fh FileHandle, fuseFlags uint32, errno syscall.Errno) {
......
......@@ -17,12 +17,12 @@ import (
)
type interruptRoot struct {
DefaultOperations
OperationStubs
child interruptOps
}
type interruptOps struct {
DefaultOperations
OperationStubs
interrupted bool
}
......
......@@ -41,7 +41,7 @@ func (n *loopbackRoot) GetAttr(ctx context.Context, out *fuse.AttrOut) syscall.E
}
type loopbackNode struct {
DefaultOperations
OperationStubs
}
func (n *loopbackNode) root() *loopbackRoot {
......
......@@ -106,7 +106,7 @@ func TestZipFS(t *testing.T) {
// zipFile is a file read from a zip archive.
type zipFile struct {
DefaultOperations
OperationStubs
file *zip.File
mu sync.Mutex
......@@ -157,7 +157,7 @@ func (zf *zipFile) Read(ctx context.Context, f FileHandle, dest []byte, off int6
// zipRoot is the root of the Zip filesystem. Its only functionality
// is populating the filesystem.
type zipRoot struct {
DefaultOperations
OperationStubs
r *zip.Reader
}
......@@ -177,7 +177,7 @@ func (zr *zipRoot) OnAdd(ctx context.Context) {
}
ch := p.GetChild(component)
if ch == nil {
ch = p.NewPersistentInode(ctx, &DefaultOperations{},
ch = p.NewPersistentInode(ctx, &OperationStubs{},
NodeAttr{Mode: fuse.S_IFDIR})
p.AddChild(component, ch, true)
}
......
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