summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2011-07-06 03:10:05 +0000
committerAnand Avati <avati@gluster.com>2011-07-07 04:45:29 -0700
commita40c52707762258eddb35a63ee1f78bc4e0a52dd (patch)
tree063ff150878ae7642777f1edaeef7965d5a25df7 /xlators
parenta7cdaf3de307c96cb55219a0743962ee1e1fc955 (diff)
dht disk usage: Correct free blk calculation
Use f_bavial instead of f_bfree for %free calculation This fixes mismatch of df output wrt backend and glusterfs where: f_bfree = /* # free blocks */ f_bavail; /* free blocks avail to non-superuser */ Signed-off-by: shishir gowda <shishirng@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 3084 (Correcting percent calculation of disk space) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3084
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/dht/src/dht-diskusage.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/cluster/dht/src/dht-diskusage.c b/xlators/cluster/dht/src/dht-diskusage.c
index 75953781ef7..2ff470ec805 100644
--- a/xlators/cluster/dht/src/dht-diskusage.c
+++ b/xlators/cluster/dht/src/dht-diskusage.c
@@ -54,8 +54,8 @@ dht_du_info_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
}
if (statvfs && statvfs->f_blocks) {
- percent = (statvfs->f_bfree * 100) / statvfs->f_blocks;
- bytes = (statvfs->f_bfree * statvfs->f_frsize);
+ percent = (statvfs->f_bavail * 100) / statvfs->f_blocks;
+ bytes = (statvfs->f_bavail * statvfs->f_frsize);
}
LOCK (&conf->subvolume_lock);