]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
include/util.h: initialize ceph_data_stats to zero
authorJoao Eduardo Luis <joao@redhat.com>
Wed, 21 Jan 2015 17:47:20 +0000 (17:47 +0000)
committerJoao Eduardo Luis <jecluis@gmail.com>
Sun, 1 Mar 2015 10:11:24 +0000 (10:11 +0000)
We decode this struct on the monitor.  Although at the moment there's no
reports of any weird behavior by not initializing it, let's avoid it
completely by setting member values to zero -- just in case and because
it's a good policy.

Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
src/include/util.h

index 4e4476ad644c9da6b410589ccddace7307284f45..7801d0654c467a1350e6f67d5b9db1f0be5a37a9 100644 (file)
@@ -30,6 +30,13 @@ struct ceph_data_stats
   uint64_t byte_avail;
   int avail_percent;
 
+  ceph_data_stats() :
+    byte_total(0),
+    byte_used(0),
+    byte_avail(0),
+    avail_percent(0)
+  { }
+
   void dump(Formatter *f) const {
     assert(f != NULL);
     f->dump_int("total", byte_total);