v2api: implement Statfs
This commit is contained in:
parent
a39fc8ab2e
commit
855b4a95b7
@ -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
|
||||
}
|
||||
|
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user