diff options
author | Jakob Unterwurzacher | 2020-06-11 22:20:15 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2020-06-21 12:01:24 +0200 |
commit | 2aad58f9ec3386cbf3de6e10a82de51052832a30 (patch) | |
tree | 5fc6616b22e076d82e1e709344431148d998f8d3 /internal | |
parent | 3b61244b72f74a25651d4ba184ac7cc62c937db0 (diff) |
v2api (go-fuse v2 api): initial noop implementation
Compiles and mounts but does nothing useful.
Diffstat (limited to 'internal')
-rw-r--r-- | internal/fusefrontend/node.go | 50 | ||||
-rw-r--r-- | internal/fusefrontend_reverse/r_node.go | 20 |
2 files changed, 70 insertions, 0 deletions
diff --git a/internal/fusefrontend/node.go b/internal/fusefrontend/node.go new file mode 100644 index 0000000..fde6a1a --- /dev/null +++ b/internal/fusefrontend/node.go @@ -0,0 +1,50 @@ +package fusefrontend + +import ( + "context" + "syscall" + + "github.com/hanwen/go-fuse/v2/fs" + "github.com/hanwen/go-fuse/v2/fuse" + + "github.com/rfjakob/gocryptfs/internal/contentenc" + "github.com/rfjakob/gocryptfs/internal/nametransform" +) + +// Node is a file or directory in the filesystem tree +// in a gocryptfs mount. +type Node struct { + fs.Inode +} + +// RootNode is the root of the filesystem tree of Nodes. +type RootNode struct { + Node + + // This flag is set to zero each time fs.isFiltered() is called + // (uint32 so that it can be reset with CompareAndSwapUint32). + // When -idle was used when mounting, idleMonitor() sets it to 1 + // periodically. + IsIdle uint32 +} + +func NewRootNode(args Args, c *contentenc.ContentEnc, n nametransform.NameTransformer) *RootNode { + // TODO + return &RootNode{} +} + +func (n *Node) path() string { + return n.Path(n.Root()) +} + +func (n *Node) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno) { + return nil, 1 +} + +func (n *Node) Getattr(ctx context.Context, f fs.FileHandle, out *fuse.AttrOut) syscall.Errno { + return 1 +} + +func (n *Node) Readdir(ctx context.Context) (fs.DirStream, syscall.Errno) { + return nil, 1 +} diff --git a/internal/fusefrontend_reverse/r_node.go b/internal/fusefrontend_reverse/r_node.go new file mode 100644 index 0000000..58ce664 --- /dev/null +++ b/internal/fusefrontend_reverse/r_node.go @@ -0,0 +1,20 @@ +package fusefrontend_reverse + +import ( + "github.com/hanwen/go-fuse/v2/fs" + + "github.com/rfjakob/gocryptfs/internal/contentenc" + "github.com/rfjakob/gocryptfs/internal/fusefrontend" + "github.com/rfjakob/gocryptfs/internal/nametransform" +) + +// RNode is a file or directory in the filesystem tree +// in a `gocryptfs -reverse` mount. +type RNode struct { + fs.Inode +} + +func NewRootNode(args fusefrontend.Args, c *contentenc.ContentEnc, n nametransform.NameTransformer) *RNode { + // TODO + return &RNode{} +} |