]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG/Backend: shuffle sub_op_push over to ReplicatedBackend
authorSamuel Just <sam.just@inktank.com>
Fri, 30 Aug 2013 21:25:32 +0000 (14:25 -0700)
committerSamuel Just <sam.just@inktank.com>
Thu, 26 Sep 2013 18:24:25 +0000 (11:24 -0700)
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/OSD.h
src/osd/ReplicatedBackend.h
src/osd/ReplicatedPG.cc
src/osd/ReplicatedPG.h

index c2f45196870d03698cafc254a660b077bb6d1afd..17256d61702d83602142476fb0ffb2a57acd0130 100644 (file)
@@ -635,6 +635,20 @@ public:
   OSDService(OSD *osd);
   ~OSDService();
 };
+
+struct C_OSD_SendMessageOnConn: public Context {
+  OSDService *osd;
+  Message *reply;
+  ConnectionRef conn;
+  C_OSD_SendMessageOnConn(
+    OSDService *osd,
+    Message *reply,
+    ConnectionRef conn) : osd(osd), reply(reply), conn(conn) {}
+  void finish(int) {
+    osd->send_message_osd_cluster(reply, conn.get());
+  }
+};
+
 class OSD : public Dispatcher,
            public md_config_obs_t {
   /** OSD **/
index 4c20f2486509c36cf102d4266f302e2f757fb4d1..ba79d06de5fe891fd19400b743fe12503aeb0784 100644 (file)
@@ -200,7 +200,7 @@ private:
   // Reverse mapping from osd peer to objects beging pulled from that peer
   map<int, set<hobject_t> > pull_from_peer;
 
-  void sub_op_push(OpRequestRef op) {}
+  void sub_op_push(OpRequestRef op);
   void sub_op_push_reply(OpRequestRef op) {}
   void sub_op_pull(OpRequestRef op) {}
 
index d0984c441d188b46e9925dbdf4bd2832335eefd5..bb6b9cc2093485a9cbb41e8b31cdd475f2fb7592 100644 (file)
@@ -80,6 +80,7 @@ PGLSFilter::~PGLSFilter()
 {
 }
 
+
 // ======================
 // PGBackend::Listener
 
@@ -6870,7 +6871,7 @@ void ReplicatedPG::trim_pushed_data(
 /** op_push
  * NOTE: called from opqueue.
  */
-void ReplicatedPG::sub_op_push(OpRequestRef op)
+void ReplicatedBackend::sub_op_push(OpRequestRef op)
 {
   op->mark_started();
   MOSDSubOp *m = static_cast<MOSDSubOp *>(op->request);
@@ -6906,9 +6907,9 @@ void ReplicatedPG::sub_op_push(OpRequestRef op)
     assert(entity_name_t::TYPE_OSD == m->get_connection()->peer_type);
     handle_push(m->get_source().num(), pop, &resp, t);
     t->register_on_complete(new C_OSD_SendMessageOnConn(
-                            osd, reply, m->get_connection()));
+                             osd, reply, m->get_connection()));
   }
-  osd->store->queue_transaction(osr.get(), t);
+  get_parent()->queue_transaction(t);
   return;
 }
 
index 22ae47287d2b05e92ddaec6723fa30c23e985c1f..368371939d1c2b7efe71c696481b96c00b1086b6 100644 (file)
@@ -813,18 +813,6 @@ protected:
       pg->_committed_pushed_object(epoch, last_complete);
     }
   };
-  struct C_OSD_SendMessageOnConn: public Context {
-    OSDService *osd;
-    Message *reply;
-    ConnectionRef conn;
-    C_OSD_SendMessageOnConn(
-      OSDService *osd,
-      Message *reply,
-      ConnectionRef conn) : osd(osd), reply(reply), conn(conn) {}
-    void finish(int) {
-      osd->send_message_osd_cluster(reply, conn.get());
-    }
-  };
   struct C_OSD_CompletedPull : public Context {
     ReplicatedPGRef pg;
     hobject_t hoid;
@@ -862,7 +850,6 @@ protected:
   void _applied_recovered_object_replica();
   void _committed_pushed_object(epoch_t epoch, eversion_t lc);
   void recover_got(hobject_t oid, eversion_t v);
-  void sub_op_push(OpRequestRef op);
   void _failed_push(int from, const hobject_t &soid);
   void sub_op_push_reply(OpRequestRef op);
   bool handle_push_reply(int peer, PushReplyOp &op, PushOp *reply);