diff options
author | Ross Lagerwall <rosslagerwall@gmail.com> | 2013-11-11 19:11:49 +0200 |
---|---|---|
committer | Ross Lagerwall <rosslagerwall@gmail.com> | 2013-11-15 16:58:12 +0200 |
commit | af1e2dd22047e1f95c245a9ada11958899f20278 (patch) | |
tree | cea06ab7eb7cc18ea2016096b2f572b204026508 | |
parent | 100dbd9a53efc0dd18a6e0f9dc7083ed584ffbee (diff) | |
download | gvfs-af1e2dd22047e1f95c245a9ada11958899f20278.tar.gz |
fuse: Round up the number of blocks that a filesystem has
If a filesystem is 4095 bytes, indicate that it uses 1 block rather than
0 blocks.
https://bugzilla.gnome.org/show_bug.cgi?id=711855
-rw-r--r-- | client/gvfsfusedaemon.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/client/gvfsfusedaemon.c b/client/gvfsfusedaemon.c index e2a59b05..11fc1d0d 100644 --- a/client/gvfsfusedaemon.c +++ b/client/gvfsfusedaemon.c @@ -654,7 +654,7 @@ vfs_statfs (const gchar *path, struct statvfs *stbuf) if (file_info) { if (g_file_info_has_attribute (file_info, G_FILE_ATTRIBUTE_FILESYSTEM_SIZE)) - stbuf->f_blocks = g_file_info_get_attribute_uint64 (file_info, G_FILE_ATTRIBUTE_FILESYSTEM_SIZE) / 4096; + stbuf->f_blocks = (g_file_info_get_attribute_uint64 (file_info, G_FILE_ATTRIBUTE_FILESYSTEM_SIZE) + 4096 - 1) / 4096; if (g_file_info_has_attribute (file_info, G_FILE_ATTRIBUTE_FILESYSTEM_FREE)) stbuf->f_bfree = stbuf->f_bavail = g_file_info_get_attribute_uint64 (file_info, G_FILE_ATTRIBUTE_FILESYSTEM_FREE) / 4096; |