Commit 6d0c2608 authored by Aaron Jacobs's avatar Aaron Jacobs

memFS.StatFS

parent 5921525a
......@@ -190,6 +190,28 @@ func (fs *memFS) deallocateInode(id fuseops.InodeID) {
// FileSystem methods
////////////////////////////////////////////////////////////////////////
func (fs *memFS) StatFS(
ctx context.Context,
op *fuseops.StatFSOp) (err error) {
fs.mu.Lock()
defer fs.mu.Unlock()
// Count free/available bytes and inodes.
op.BlockSize = 1
op.BlocksFree = Capacity_Bytes
op.BlocksAvailable = Capacity_Bytes
op.Inodes = Capacity_Files
op.InodesFree = Capacity_Files
for _, in := range fs.inodes {
op.InodesFree--
op.BlocksFree -= in.attrs.Size
op.BlocksAvailable -= in.attrs.Size
}
return
}
func (fs *memFS) LookUpInode(
ctx context.Context,
op *fuseops.LookUpInodeOp) (err error) {
......
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