]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
MOSDOp: drop ops vector in clear_data()
authorSamuel Just <sam.just@inktank.com>
Sat, 1 Mar 2014 21:39:57 +0000 (13:39 -0800)
committerSamuel Just <sam.just@inktank.com>
Sat, 1 Mar 2014 22:53:52 +0000 (14:53 -0800)
Otherwise, clear_data on MOSDOp will leave essentially
all of the buffers intact.  This is a problem since the
OpTracker mechanism relies on being able to keep the mesage
around without keeping around the data.

Signed-off-by: Samuel Just <sam.just@inktank.com>
src/messages/MOSDOp.h
src/msg/Message.h

index 32408bebeedb775438a988a950152bc427a37de8..5c70d8bbc47c9f1e2eaf9fb97fe18daff3b3488d 100644 (file)
@@ -337,6 +337,9 @@ struct ceph_osd_request_head {
     OSDOp::split_osd_op_vector_in_data(ops, data);
   }
 
+  void clear_buffers() {
+    ops.clear();
+  }
 
   const char *get_type_name() const { return "osd_op"; }
   void print(ostream& out) const {
index fbca242e2052a54ba3974a180387b541a03a6bbd..740be7be716c3a39b1034460ea6df43028d6578e 100644 (file)
@@ -403,10 +403,13 @@ public:
     payload.clear();
     middle.clear();
   }
+
+  virtual void clear_buffers() {}
   void clear_data() {
     if (byte_throttler)
       byte_throttler->put(data.length());
     data.clear();
+    clear_buffers(); // let subclass drop buffers as well
   }
 
   bool empty_payload() { return payload.length() == 0; }