GNOME Bugzilla – Bug 625751
[PATCH] Add G_FILE_ATTRIBUTE_FILESYSTEM_USED
Last modified: 2012-01-10 02:54:38 UTC
To get the correct information of how many bytes is used in the file system it isn't enough to do total - free because of the (default) 5% reserved for root. Therefor I propose to add a new attribute, G_FILE_ATTRIBUTE_FILESYSTEM_USED, that uses statfs.f_bfree instead of statfs.f_bavail. This will help nautilus bug 559311 to report the same as the df command.
Created attachment 166913 [details] [review] Improve readability by adding comments for #ifs and #ifdefs But first a patch that's improve readability in the g_local_file_query_filesystem_info() function.
Created attachment 166914 [details] [review] Adds G_FILE_ATTRIBUTE_FILESYSTEM_USED to get exact used space from fs
So it has been 10 months now. Did this patch ever get applied or has it just been ignored?
I haven't got any comment on this. Maybe one should ping Alex about it?
Ping.
Tomas, can you take a look ?
Review of attachment 166913 [details] [review]: This one looks good, please commit.
Review of attachment 166914 [details] [review]: The patch looks good to me too, we use statfs_buffer.f_bavail (free blocks for unprivileged users) as a default way to retrieve real free space which is great. Just a side note - please include link to this bugreport in patch comments to have a backwards reference. ::: gio/gfileinfo.h @@ +736,3 @@ + * %G_FILE_ATTRIBUTE_TYPE_UINT64. + **/ +#define G_FILE_ATTRIBUTE_FILESYSTEM_USED "filesystem::used" /* uint64 */ Would be useful to update docs in gfileattribute.c as well