1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

vfs_ceph: fix disk_free_fn callback

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@redhat.com>
Reviewed-by: Ira Cooper <ira@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): Ira Cooper <ira@samba.org>
Autobuild-Date(master): Mon Feb 16 18:14:02 CET 2015 on sn-devel-104
This commit is contained in:
Yan, Zheng 2015-02-13 18:25:57 +08:00 committed by Ira Cooper
parent d1da1f78a5
commit 2501afe08b

View File

@ -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;