From 0c055a121588354d2e279540265713b9c596efc9 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 9 May 2017 14:38:06 +0100 Subject: [PATCH] cmount: Statfs: reduce max size of volume for Windows --- cmd/cmount/fs.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/cmount/fs.go b/cmd/cmount/fs.go index 267d7a093..a3203ed4a 100644 --- a/cmd/cmount/fs.go +++ b/cmd/cmount/fs.go @@ -6,6 +6,7 @@ package cmount import ( "os" "path" + "runtime" "sync" "time" @@ -312,11 +313,13 @@ func (fsys *FS) Releasedir(path string, fh uint64) (errc int) { } // Statfs reads overall stats on the filessystem -// FIXME doesn't seem to be ever called func (fsys *FS) Statfs(path string, stat *fuse.Statfs_t) (errc int) { defer fs.Trace(path, "")("stat=%+v, errc=%d", stat, &errc) const blockSize = 4096 - const fsBlocks = (1 << 50) / blockSize + fsBlocks := uint64(1 << 50) + if runtime.GOOS == "windows" { + fsBlocks = (1 << 43) - 1 + } stat.Blocks = fsBlocks // Total data blocks in file system. stat.Bfree = fsBlocks // Free blocks in file system. stat.Bavail = fsBlocks // Free blocks in file system if you're not root.