diff options
author | Jakob Unterwurzacher | 2020-07-11 18:59:54 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2020-07-11 18:59:54 +0200 |
commit | 855b4a95b794b9905c68afff2863138461a4be3a (patch) | |
tree | 75973b005ab1f6587dd72137645267964f24511a /internal | |
parent | a39fc8ab2e559113f23d64ff87d59842317bbb8c (diff) |
v2api: implement Statfs
Diffstat (limited to 'internal')
-rw-r--r-- | internal/fusefrontend/node.go | 14 | ||||
-rw-r--r-- | internal/fusefrontend/node_api_check.go | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/internal/fusefrontend/node.go b/internal/fusefrontend/node.go index dae38df..bdc30b3 100644 --- a/internal/fusefrontend/node.go +++ b/internal/fusefrontend/node.go @@ -282,3 +282,17 @@ func (n *Node) Setattr(ctx context.Context, f fs.FileHandle, in *fuse.SetAttrIn, } return f2.Setattr(ctx, in, out) } + +// StatFs - FUSE call. Returns information about the filesystem. +// +// Symlink-safe because the path is ignored. +func (n *Node) Statfs(ctx context.Context, out *fuse.StatfsOut) syscall.Errno { + p := n.rootNode().args.Cipherdir + var st syscall.Statfs_t + err := syscall.Statfs(p, &st) + if err != nil { + return fs.ToErrno(err) + } + out.FromStatfsT(&st) + return 0 +} diff --git a/internal/fusefrontend/node_api_check.go b/internal/fusefrontend/node_api_check.go index 9168ea5..384badc 100644 --- a/internal/fusefrontend/node_api_check.go +++ b/internal/fusefrontend/node_api_check.go @@ -16,9 +16,9 @@ var _ = (fs.NodeReadlinker)((*Node)(nil)) var _ = (fs.NodeOpener)((*Node)(nil)) var _ = (fs.NodeOpendirer)((*Node)(nil)) var _ = (fs.NodeSetattrer)((*Node)(nil)) +var _ = (fs.NodeStatfser)((*Node)(nil)) /* TODO -var _ = (fs.NodeStatfser)((*Node)(nil)) var _ = (fs.NodeGetxattrer)((*Node)(nil)) var _ = (fs.NodeSetxattrer)((*Node)(nil)) var _ = (fs.NodeRemovexattrer)((*Node)(nil)) |