]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedBackend: remove MOSDSubOp cruft from repop_commit 13401/head
authorSage Weil <sage@redhat.com>
Tue, 28 Mar 2017 21:01:13 +0000 (17:01 -0400)
committerSage Weil <sage@redhat.com>
Fri, 31 Mar 2017 18:42:12 +0000 (14:42 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/ReplicatedBackend.cc

index 46ea89dd334a5a3b4a9e6f1c25bc109709c74cc9..309daf914d418ba08ff47457dfbfc6b89b0b4a4b 100644 (file)
@@ -1179,38 +1179,23 @@ void ReplicatedBackend::repop_commit(RepModifyRef rm)
   rm->committed = true;
 
   // send commit.
-  dout(10) << __func__ << " on op " << *rm->op->get_req()
+  const Message *m = rm->op->get_req();
+  dout(10) << __func__ << " on op " << *m
           << ", sending commit to osd." << rm->ackerosd
           << dendl;
-
+  assert(m->get_type() == MSG_OSD_REPOP);
   assert(get_osdmap()->is_up(rm->ackerosd));
-  get_parent()->update_last_complete_ondisk(rm->last_complete);
 
-  const Message *m = rm->op->get_req();
-  Message *commit = NULL;
-  if (m->get_type() == MSG_OSD_SUBOP) {
-    // doesn't have CLIENT SUBOP feature ,use Subop
-    MOSDSubOpReply  *reply = new MOSDSubOpReply(
-      static_cast<const MOSDSubOp*>(m),
-      get_parent()->whoami_shard(),
-      0, get_osdmap()->get_epoch(), CEPH_OSD_FLAG_ONDISK);
-    reply->set_last_complete_ondisk(rm->last_complete);
-    commit = reply;
-  } else if (m->get_type() == MSG_OSD_REPOP) {
-    MOSDRepOpReply *reply = new MOSDRepOpReply(
-      static_cast<const MOSDRepOp*>(m),
-      get_parent()->whoami_shard(),
-      0, get_osdmap()->get_epoch(), CEPH_OSD_FLAG_ONDISK);
-    reply->set_last_complete_ondisk(rm->last_complete);
-    commit = reply;
-  }
-  else {
-    ceph_abort();
-  }
+  get_parent()->update_last_complete_ondisk(rm->last_complete);
 
-  commit->set_priority(CEPH_MSG_PRIO_HIGH); // this better match ack priority!
+  MOSDRepOpReply *reply = new MOSDRepOpReply(
+    static_cast<const MOSDRepOp*>(m),
+    get_parent()->whoami_shard(),
+    0, get_osdmap()->get_epoch(), CEPH_OSD_FLAG_ONDISK);
+  reply->set_last_complete_ondisk(rm->last_complete);
+  reply->set_priority(CEPH_MSG_PRIO_HIGH); // this better match ack priority!
   get_parent()->send_message_osd_cluster(
-    rm->ackerosd, commit, get_osdmap()->get_epoch());
+    rm->ackerosd, reply, get_osdmap()->get_epoch());
 
   log_subop_stats(get_parent()->get_logger(), rm->op, l_osd_sop_w);
 }