Skip to content

Commit

Permalink
Remove goofys-fuse StatFS dependency from cluster code (add some copy…
Browse files Browse the repository at this point in the history
…-paste!)
  • Loading branch information
vitalif committed Jun 9, 2023
1 parent 96589d6 commit 21a8aea
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion internal/cluster_fs_fuse.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
iofs "io/fs"
"fmt"
"syscall"
"sync/atomic"

"github.com/yandex-cloud/geesefs/api/common"
"github.com/jacobsa/fuse"
Expand All @@ -24,7 +25,21 @@ type ClusterFsFuse struct {
// fs

func (fs *ClusterFsFuse) StatFS(ctx context.Context, op *fuseops.StatFSOp) error {
return fs.Goofys.StatFS(ctx, op)
atomic.AddInt64(&fs.Goofys.stats.metadataReads, 1)

const BLOCK_SIZE = 4096
const TOTAL_SPACE = 1 * 1024 * 1024 * 1024 * 1024 * 1024 // 1PB
const TOTAL_BLOCKS = TOTAL_SPACE / BLOCK_SIZE
const INODES = 1 * 1000 * 1000 * 1000 // 1 billion
op.BlockSize = BLOCK_SIZE
op.Blocks = TOTAL_BLOCKS
op.BlocksFree = TOTAL_BLOCKS
op.BlocksAvailable = TOTAL_BLOCKS
op.IoSize = 1 * 1024 * 1024 // 1MB
op.Inodes = INODES
op.InodesFree = INODES

return nil
}

// file
Expand Down

0 comments on commit 21a8aea

Please sign in to comment.