]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/pgmonitor: use appropriate forced conversions in get_rule_avail 7705/head
authorrenhwztetecs <rhwlyw@163.com>
Fri, 19 Feb 2016 06:56:24 +0000 (14:56 +0800)
committerrenhwztetecs <rhwlyw@163.com>
Fri, 19 Feb 2016 06:56:24 +0000 (14:56 +0800)
use appropriate forced conversions in get_rule_avail

Signed-off-by: huanwen ren <ren.huanwen@zte.com.cn>
src/mon/PGMonitor.cc

index 60ce45d49412654158c4f36daa73ba6847f28f3b..e26243e2b69e4aaf293ac7f7bafb02c1f7519cee 100644 (file)
@@ -1394,8 +1394,8 @@ int64_t PGMonitor::get_rule_avail(OSDMap& osdmap, int ruleno) const
        // calculate proj below.
        continue;
       }
-      int64_t proj = (float)((osd_info->second).kb_avail * 1024ull) /
-                     (double)p->second;
+      int64_t proj = (int64_t)((double)((osd_info->second).kb_avail * 1024ull) /
+                     (double)p->second);
       if (min < 0 || proj < min)
        min = proj;
     } else {