From: robk-tahoe Date: Wed, 7 May 2008 23:40:09 +0000 (-0700) Subject: tahoefuse: return bogus but useful data to statfs call X-Git-Tag: allmydata-tahoe-1.1.0~150 X-Git-Url: https://git.rkrishnan.org/pf/content/%22file:?a=commitdiff_plain;h=8179daee4adf1a3224d3e2666a8a296d76ea6179;p=tahoe-lafs%2Ftahoe-lafs.git tahoefuse: return bogus but useful data to statfs call previously tahoefuse returned the fs stat for the filesystem the fuse plugin was running upon (e.g. '/'). this works ok until you need to copy more to tahoe than the local machine has free disk space, at which point Finder will refuse to copy 'too much' data. this changes it so that tahoe always reports 2TiB used of an 8TiB filesystem this is entirely bogus, but allows copies of up to 2TiB to be initiated. --- diff --git a/mac/tahoefuse.py b/mac/tahoefuse.py index fe97577c..5fce5d44 100644 --- a/mac/tahoefuse.py +++ b/mac/tahoefuse.py @@ -329,7 +329,22 @@ class TahoeFuse(fuse.Fuse): - f_ffree - nunber of free file inodes """ - return os.statvfs(".") + block_size = 4096 # 4k + preferred_block_size = 131072 # 128k, c.f. seg_size + fs_size = 8*2**40 # 8Tb + fs_free = 2*2**40 # 2Tb + + s = fuse.StatVfs(f_bsize = preferred_block_size, + f_frsize = block_size, + f_blocks = fs_size / block_size, + f_bfree = fs_free / block_size, + f_bavail = fs_free / block_size, + f_files = 2**30, # total files + f_ffree = 2**20, # available files + f_favail = 2**20, # available files (root) + f_flag = 2, # no suid + f_namemax = 255) # max name length + return s def fsinit(self): self.log("fsinit()")