I would like to be able to see used/available space in the properties of a SMB share folder - just like in my home folder.
I can see that "ls" in smbclient returns this information so it should be readily available from the share. Example: "38093 blocks of size 8388608. 32358 blocks available"
This should be implemented for a while already, looking at some sample servers I am not sure that is actually working correctly though. Possibly related https://bugzilla.samba.org/show_bug.cgi?id=11810
With a windows10 or ubuntu18.04 server the actual block is f_frsize*f_bsize by the looks of it, which is I think not how statvfs should behave anywhere.
Anyway, needs investigation.
Quick update: seems statvfs outright makes up its own meaning
without unix extension the actual blocksize is f_frsize*f_bsize, with unix extension f_frsize is not getting set at all, I guess we need to handle these separately on our end as well `if(f_frsize==0)`
Git commit 6832817f311bfa106ee971ae51bac288843af08b by Harald Sitter.
Committed on 13/02/2020 at 11:17.
Pushed by sitter into branch 'master'.
smb: fix free space calculation
- collapse statvfs call, there's no purpose in manually opening the file
when libsmbc has a convenience wrapper that does exactly what we need
with less code on our end
- blockSize is now calculated as per the conditional branches in
- free space calculation is now backwards compatible with slightly busted
legacy versions of libsmbc not setting f_bavail
Test Plan: free space calculation now works with windows10, ubuntu18.04, ubuntu19.10
Reviewers: ngraham, meven
Reviewed By: ngraham, meven
Subscribers: meven, kde-frameworks-devel, kfm-devel
Tags: #dolphin, #frameworks
Differential Revision: https://phabricator.kde.org/D27294
M +20 -17 smb/kio_smb_browse.cpp