]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: init vars in AioRequest ctor
authorSage Weil <sage@inktank.com>
Mon, 22 Oct 2012 03:55:41 +0000 (20:55 -0700)
committerSage Weil <sage@inktank.com>
Mon, 22 Oct 2012 03:55:41 +0000 (20:55 -0700)
At (2): Non-static class member "m_object_no" is not initialized in this constructor nor in any functions that it calls.
At (4): Non-static class member "m_object_off" is not initialized in this constructor nor in any functions that it calls.
CID 717222 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
At (6): Non-static class member "m_object_len" is not initialized in this constructor nor in any functions that it calls.

CID 717223 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
At (2): Non-static class member "m_parent_overlap" is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Sage Weil <sage@inktank.com>
src/librbd/AioRequest.cc

index 8ad7416ac3b44a24f37298be48a9af2f39bf5af7..1e535d13d1d8d7befa9b7e79ae4673e69deea206 100644 (file)
@@ -19,6 +19,7 @@ namespace librbd {
 
   AioRequest::AioRequest() :
     m_ictx(NULL),
+    m_object_no(0), m_object_off(0), m_object_len(0),
     m_snap_id(CEPH_NOSNAP), m_completion(NULL), m_parent_completion(NULL),
     m_hide_enoent(false) {}
   AioRequest::AioRequest(ImageCtx *ictx, const std::string &oid,
@@ -108,7 +109,9 @@ namespace librbd {
 
   /** read **/
 
-  AbstractWrite::AbstractWrite() : m_state(LIBRBD_AIO_WRITE_FINAL) {}
+  AbstractWrite::AbstractWrite()
+    : m_state(LIBRBD_AIO_WRITE_FINAL),
+      m_parent_overlap(0) {}
   AbstractWrite::AbstractWrite(ImageCtx *ictx, const std::string &oid,
                               uint64_t object_no, uint64_t object_off, uint64_t len,
                               vector<pair<uint64_t,uint64_t> >& objectx,