[PATCH] vfs_ceph: fix disk_free_fn callback
Yan, Zheng
zyan at redhat.com
Fri Feb 13 03:25:57 MST 2015
Free space and available space should be in unit of block size. Besides,
we should call disk_norm() to adjust the returned values.
Signed-off-by: Yan, Zheng <zyan at redhat.com>
---
source3/modules/vfs_ceph.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
index ec72312..b074e2d 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -167,8 +167,9 @@ static uint64_t cephwrap_disk_free(struct vfs_handle_struct *handle, const char
* Provide all the correct values.
*/
*bsize = statvfs_buf.f_bsize;
- *dfree = statvfs_buf.f_bsize * statvfs_buf.f_bavail;
- *dsize = statvfs_buf.f_bsize * statvfs_buf.f_blocks;
+ *dfree = statvfs_buf.f_bavail;
+ *dsize = statvfs_buf.f_blocks;
+ disk_norm(small_query, bsize, dfree, dsize);
DEBUG(10, ("[CEPH] bsize: %llu, dfree: %llu, dsize: %llu\n",
llu(*bsize), llu(*dfree), llu(*dsize)));
return *dfree;
--
1.9.3
More information about the samba-technical
mailing list