mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
vfs,mount,cmount: use About to return the correct disk total/used/free
Disks total, used, free now shows correctly for mount and cmount (eg `df` for Unix or in the Windows explorer).
This commit is contained in:
@@ -62,6 +62,16 @@ func (f *FS) Statfs(ctx context.Context, req *fuse.StatfsRequest, resp *fuse.Sta
|
||||
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.
|
||||
total, used, free := f.VFS.Statfs()
|
||||
if total >= 0 {
|
||||
resp.Blocks = uint64(total) / blockSize
|
||||
}
|
||||
if used >= 0 {
|
||||
resp.Bfree = resp.Blocks - uint64(used)/blockSize
|
||||
}
|
||||
if free >= 0 {
|
||||
resp.Bavail = uint64(free) / blockSize
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user