"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
mount: Implement statfs interface so df works - fixes #894
Nick Craig-Woodc41b67ea0889
diff --git a/cmd/mount/fs.go b/cmd/mount/fs.goindex 523268de3..0e63e7557 100644--- a/cmd/mount/fs.go+++ b/cmd/mount/fs.go@@ -8,6 +8,7 @@ import ("bazil.org/fuse"fusefs "bazil.org/fuse/fs""github.com/ncw/rclone/fs"+ "golang.org/x/net/context")// FS represents the top level filing system@@ -97,3 +98,22 @@ func mount(f fs.Fs, mountpoint string) (<-chan error, error) {return errChan, nil}++// Check interface satsified+var _ fusefs.FSStatfser = (*FS)(nil)++// Statfs is called to obtain file system metadata.+// It should write that data to resp.+func (f *FS) Statfs(ctx context.Context, req *fuse.StatfsRequest, resp *fuse.StatfsResponse) error {+ const blockSize = 4096+ const fsBlocks = (1 << 50) / blockSize+ resp.Blocks = fsBlocks // Total data blocks in file system.+ resp.Bfree = fsBlocks // Free blocks in file system.+ resp.Bavail = fsBlocks // Free blocks in file system if you're not root.+ resp.Files = 1E9 // Total files in file system.+ resp.Ffree = 1E9 // Free files in file system.+ resp.Bsize = blockSize // Block size+ resp.Namelen = 255 // Maximum file name length?+ resp.Frsize = blockSize // Fragment size, smallest addressable data size in the file system.+ return nil+}diff --git a/vendor/bazil.org/fuse/fuse.go b/vendor/bazil.org/fuse/fuse.goindex efd684673..c6173b144 100644--- a/vendor/bazil.org/fuse/fuse.go+++ b/vendor/bazil.org/fuse/fuse.go@@ -1262,6 +1262,7 @@ func (r *StatfsRequest) Respond(resp *StatfsResponse) {Bfree: resp.Bfree,Bavail: resp.Bavail,Files: resp.Files,+ Ffree: resp.Ffree,Bsize: resp.Bsize,Namelen: resp.Namelen,Frsize: resp.Frsize,