]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: optracker (2): remove all unecessary message put()
authorJoao Eduardo Luis <joao@redhat.com>
Wed, 25 Feb 2015 18:40:33 +0000 (18:40 +0000)
committerJoao Eduardo Luis <joao@suse.de>
Thu, 16 Jul 2015 17:03:39 +0000 (18:03 +0100)
Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
18 files changed:
src/mon/AuthMonitor.cc
src/mon/ConfigKeyService.cc
src/mon/DataHealthService.cc
src/mon/Elector.cc
src/mon/HealthMonitor.cc
src/mon/LogMonitor.cc
src/mon/MDSMonitor.cc
src/mon/MDSMonitor.h
src/mon/Monitor.cc
src/mon/Monitor.h
src/mon/MonmapMonitor.cc
src/mon/OSDMonitor.cc
src/mon/OSDMonitor.h
src/mon/PGMonitor.cc
src/mon/PGMonitor.h
src/mon/Paxos.cc
src/mon/PaxosService.cc
src/mon/PaxosService.h

index 01bd0a6cacd0321f67e7da8a2e42f7e845c8f460..4a6308b51274a46fac4e19e7a0e5c2adfa5f1b31 100644 (file)
@@ -293,7 +293,6 @@ bool AuthMonitor::preprocess_query(MonOpRequestRef op)
 
   default:
     assert(0);
-    m->put();
     return true;
   }
 }
@@ -311,7 +310,6 @@ bool AuthMonitor::prepare_update(MonOpRequestRef op)
     return prep_auth(op, true);
   default:
     assert(0);
-    m->put();
     return false;
   }
 }
@@ -363,7 +361,6 @@ bool AuthMonitor::prep_auth(MonOpRequestRef op, bool paxos_writable)
   MonSession *s = (MonSession *)m->get_connection()->get_priv();
   if (!s) {
     dout(10) << "no session, dropping" << dendl;
-    m->put();
     return true;
   }
 
@@ -513,7 +510,6 @@ bool AuthMonitor::prep_auth(MonOpRequestRef op, bool paxos_writable)
 reply:
   reply = new MAuthReply(proto, &response_bl, ret, s->global_id);
   mon->send_reply(m, reply);
-  m->put();
 done:
   s->put();
   return true;
@@ -1013,7 +1009,6 @@ bool AuthMonitor::prepare_global_id(MonOpRequestRef op)
   dout(10) << "AuthMonitor::prepare_global_id" << dendl;
   increase_max_global_id();
 
-  //m->put();
   return true;
 }
 
index 70e7858e29e2ae20c54cc5131aa2c6737ce0f9cc..5a26c5730f92c52afef13150909d0449878f1bc7 100644 (file)
@@ -94,7 +94,6 @@ bool ConfigKeyService::service_dispatch(MonOpRequestRef op)
   dout(10) << __func__ << " " << *m << dendl;
   if (!in_quorum()) {
     dout(1) << __func__ << " not in quorum -- ignore message" << dendl;
-    m->put();
     return false;
   }
 
@@ -196,8 +195,6 @@ out:
   if (!cmd->get_source().is_mon()) {
     string rs = ss.str();
     mon->reply_command(cmd, ret, rs, rdata, 0);
-  } else {
-    cmd->put();
   }
 
   return (ret == 0);
index 522a409f29c29c5c163d4573573ac3fd597a257c..47bf71dc4f6fbb0e7f4090c00648848378ae0adb 100644 (file)
@@ -246,7 +246,6 @@ bool DataHealthService::service_dispatch_op(MonOpRequestRef op)
   assert(m->get_service_type() == get_type());
   if (!in_quorum()) {
     dout(1) << __func__ << " not in quorum -- drop message" << dendl;
-    m->put();
     return false;
   }
 
@@ -260,6 +259,5 @@ bool DataHealthService::service_dispatch_op(MonOpRequestRef op)
       assert(0 == "Unknown service op");
       break;
   }
-  m->put();
   return true;
 }
index f4da7dc155937d9a6e64fa77aba0bcfb2a131633..2b88626ffbc66c9c6fa5fabcb09a77762b80f6d9 100644 (file)
@@ -237,7 +237,6 @@ void Elector::handle_propose(MonOpRequestRef op)
       mon->start_election();
     } else {
       dout(5) << " ignoring old propose" << dendl;
-      m->put();
       return;
     }
   }
@@ -264,8 +263,6 @@ void Elector::handle_propose(MonOpRequestRef op)
       dout(5) << "no, we already acked " << leader_acked << dendl;
     }
   }
-  
-  m->put();
 }
  
 void Elector::handle_ack(MonOpRequestRef op)
@@ -279,7 +276,6 @@ void Elector::handle_ack(MonOpRequestRef op)
     dout(5) << "woah, that's a newer epoch, i must have rebooted.  bumping and re-starting!" << dendl;
     bump_epoch(m->epoch);
     start();
-    m->put();
     return;
   }
   assert(m->epoch == epoch);
@@ -288,7 +284,6 @@ void Elector::handle_ack(MonOpRequestRef op)
       required_features) {
     dout(5) << " ignoring ack from mon" << from
            << " without required features" << dendl;
-    m->put();
     return;
   }
   
@@ -308,8 +303,6 @@ void Elector::handle_ack(MonOpRequestRef op)
     // ignore, i'm deferring already.
     assert(leader_acked >= 0);
   }
-  
-  m->put();
 }
 
 
@@ -329,7 +322,6 @@ void Elector::handle_victory(MonOpRequestRef op)
     dout(5) << "woah, that's a funny epoch, i must have rebooted.  bumping and re-starting!" << dendl;
     bump_epoch(m->epoch);
     start();
-    m->put();
     return;
   }
 
@@ -354,8 +346,6 @@ void Elector::handle_victory(MonOpRequestRef op)
     mon->get_classic_monitor_commands(&new_cmds, &cmdsize);
     mon->set_leader_supported_commands(new_cmds, cmdsize);
   }
-
-  m->put();
 }
 
 void Elector::nak_old_peer(MonOpRequestRef op)
@@ -375,7 +365,6 @@ void Elector::nak_old_peer(MonOpRequestRef op)
     mon->features.encode(reply->sharing_bl);
     m->get_connection()->send_message(reply);
   }
-  m->put();
 }
 
 void Elector::handle_nak(MonOpRequestRef op)
@@ -403,12 +392,10 @@ void Elector::dispatch(MonOpRequestRef op)
   case MSG_MON_ELECTION:
     {
       if (!participating) {
-        m->put();
         return;
       }
       if (op->get_req()->get_source().num() >= mon->monmap->size()) {
        dout(5) << " ignoring bogus election message with bad mon rank " 
-       m->put();
                << op->get_req()->get_source() << dendl;
        return;
       }
@@ -419,14 +406,12 @@ void Elector::dispatch(MonOpRequestRef op)
       if (em->fsid != mon->monmap->fsid) {
        dout(0) << " ignoring election msg fsid " 
                << em->fsid << " != " << mon->monmap->fsid << dendl;
-       m->put();
        return;
       }
 
       if (!mon->monmap->contains(em->get_source_addr())) {
        dout(1) << "discarding election message: " << em->get_source_addr()
                << " not in my monmap " << *mon->monmap << dendl;
-       m->put();
        return;
       }
 
@@ -445,7 +430,6 @@ void Elector::dispatch(MonOpRequestRef op)
        //mon->monmon()->paxos->stash_latest(mon->monmap->epoch, em->monmap_bl);
        cancel_timer();
        mon->bootstrap();
-       m->put();
        delete peermap;
        return;
       }
@@ -464,7 +448,6 @@ void Elector::dispatch(MonOpRequestRef op)
 
       if (em->epoch < epoch) {
        dout(5) << "old epoch, dropping" << dendl;
-       em->put();
        break;
       }
 
index 926934c7f644d1ad782d9e8964274d2fbbfe18ae..24ac84c850fa9bf24fa09af3efcb59539936a3e4 100644 (file)
@@ -61,7 +61,6 @@ bool HealthMonitor::service_dispatch(MonOpRequestRef op)
   if (services.count(service_type) == 0) {
     dout(1) << __func__ << " service type " << service_type
             << " not registered -- drop message!" << dendl;
-    //m->put();
     return false;
   }
   return services[service_type]->service_dispatch(op);
index 4e8d66f79b791a697540eaad3e071f67e34feead..01a039f339c93a233efb6353c729ee9526255aa6 100644 (file)
@@ -277,7 +277,6 @@ bool LogMonitor::preprocess_query(MonOpRequestRef op)
 
   default:
     assert(0);
-    m->put();
     return true;
   }
 }
@@ -293,7 +292,6 @@ bool LogMonitor::prepare_update(MonOpRequestRef op)
     return prepare_log(op);
   default:
     assert(0);
-    m->put();
     return false;
   }
 }
@@ -327,7 +325,6 @@ bool LogMonitor::preprocess_log(MonOpRequestRef op)
   return false;
 
  done:
-  m->put();
   return true;
 }
 
@@ -339,7 +336,6 @@ bool LogMonitor::prepare_log(MonOpRequestRef op)
   if (m->fsid != mon->monmap->fsid) {
     dout(0) << "handle_log on fsid " << m->fsid << " != " << mon->monmap->fsid 
            << dendl;
-    m->put();
     return false;
   }
 
@@ -361,8 +357,6 @@ void LogMonitor::_updated_log(MonOpRequestRef op)
   MLog *m = static_cast<MLog*>(op->get_req());
   dout(7) << "_updated_log for " << m->get_orig_source_inst() << dendl;
   mon->send_reply(m, new MLogAck(m->fsid, m->entries.rbegin()->seq));
-
-  m->put();
 }
 
 bool LogMonitor::should_propose(double& delay)
index 60c28ac7239d42c5f8d84fbc435ed48665d6f330..17eb6675fe1699dd20398c4423f6d65fd8373532 100644 (file)
@@ -230,7 +230,6 @@ bool MDSMonitor::preprocess_query(MonOpRequestRef op)
 
   default:
     assert(0);
-    m->put();
     return true;
   }
 }
@@ -298,7 +297,6 @@ bool MDSMonitor::preprocess_beacon(MonOpRequestRef op)
     if (state != MDSMap::STATE_BOOT) {
       dout(7) << "mds_beacon " << *m << " is not in mdsmap" << dendl;
       mon->send_reply(m, new MMDSMap(mon->monmap->fsid, &mdsmap));
-      m->put();
       return true;
     } else {
       return false;  // not booted yet.
@@ -366,13 +364,11 @@ bool MDSMonitor::preprocess_beacon(MonOpRequestRef op)
   mon->send_reply(m,
                  new MMDSBeacon(mon->monmap->fsid, m->get_global_id(), m->get_name(),
                                 mdsmap.get_epoch(), state, seq));
-  m->put();
   return true;
 
  ignore:
   // I won't reply this beacon, drop it.
   mon->no_reply(m);
-  m->put();
   return true;
 }
 
@@ -400,7 +396,6 @@ bool MDSMonitor::preprocess_offload_targets(MonOpRequestRef op)
   return false;
 
  done:
-  m->put();
   return true;
 }
 
@@ -423,7 +418,6 @@ bool MDSMonitor::prepare_update(MonOpRequestRef op)
   
   default:
     assert(0);
-    m->put();
   }
 
   return true;
@@ -549,7 +543,6 @@ bool MDSMonitor::prepare_beacon(MonOpRequestRef op)
           info.state = MDSMap::STATE_STANDBY_REPLAY;
           info.state_seq = seq;
         } else {
-          m->put();
           return false;
         }
       } else if (m->get_standby_for_rank() >= 0 &&
@@ -560,7 +553,6 @@ bool MDSMonitor::prepare_beacon(MonOpRequestRef op)
         info.standby_for_rank = m->get_standby_for_rank();
       } else { //it's a standby for anybody, and is already in the list
         assert(pending_mdsmap.get_mds_info().count(info.global_id));
-        m->put();
         return false;
       }
     } else if (state == MDSMap::STATE_DAMAGED) {
@@ -634,7 +626,6 @@ bool MDSMonitor::prepare_offload_targets(MonOpRequestRef op)
   } else {
     dout(10) << "prepare_offload_targets " << gid << " not in map" << dendl;
   }
-  m->put();
   return true;
 }
 
@@ -662,7 +653,6 @@ void MDSMonitor::_updated(MonOpRequestRef op)
                                      m->get_state(),
                                      m->get_seq()));
   }
-  m->put();
 }
 
 void MDSMonitor::on_active()
index 714ed34a87320d9bbf729d8ca545866bb3405957..b840b1e7c2e99246d27d378ec5ab60e28f479599 100644 (file)
@@ -60,7 +60,6 @@ class MDSMonitor : public PaxosService {
        mm->_updated(op);   // success
       else if (r == -ECANCELED) {
        mm->mon->no_reply(op->get_req<PaxosServiceMessage>());
-//     m->put();
       } else {
        mm->dispatch(op);        // try again
       }
index a036ac43cbdbbc3b8ba76510034f0fa0edea3f7e..900ac4f58b7f41b1c5dfc0996da78443e0b95e00 100644 (file)
@@ -1261,7 +1261,6 @@ void Monitor::handle_sync(MonOpRequestRef op)
     dout(0) << __func__ << " unknown op " << m->op << dendl;
     assert(0 == "unknown op");
   }
-  m->put();
 }
 
 // leader
@@ -1544,7 +1543,6 @@ void Monitor::handle_probe(MonOpRequestRef op)
 
   if (m->fsid != monmap->fsid) {
     dout(0) << "handle_probe ignoring fsid " << m->fsid << " != " << monmap->fsid << dendl;
-    m->put();
     return;
   }
 
@@ -1563,9 +1561,6 @@ void Monitor::handle_probe(MonOpRequestRef op)
         << ", missing " << (required_features & ~CEPH_FEATURES_ALL)
         << dendl;
     break;
-
-  default:
-    m->put();
   }
 }
 
@@ -1624,7 +1619,7 @@ void Monitor::handle_probe_probe(MonOpRequestRef op)
   }
 
  out:
-  m->put();
+  return;
 }
 
 void Monitor::handle_probe_reply(MonOpRequestRef op)
@@ -1635,7 +1630,6 @@ void Monitor::handle_probe_reply(MonOpRequestRef op)
 
   // discover name and addrs during probing or electing states.
   if (!is_probing() && !is_electing()) {
-    m->put();
     return;
   }
 
@@ -1653,7 +1647,6 @@ void Monitor::handle_probe_reply(MonOpRequestRef op)
               << ", mine was " << monmap->get_epoch() << dendl;
       delete newmap;
       monmap->decode(m->monmap_bl);
-      m->put();
 
       bootstrap();
       return;
@@ -1670,7 +1663,6 @@ void Monitor::handle_probe_reply(MonOpRequestRef op)
     monmap->rename(peer_name, m->name);
 
     if (is_electing()) {
-      m->put();
       bootstrap();
       return;
     }
@@ -1684,7 +1676,6 @@ void Monitor::handle_probe_reply(MonOpRequestRef op)
       monmap->get_addr(m->name).is_blank_ip()) {
     dout(1) << " learned initial mon " << m->name << " addr " << m->get_source_addr() << dendl;
     monmap->set_addr(m->name, m->get_source_addr());
-    m->put();
 
     bootstrap();
     return;
@@ -1692,7 +1683,6 @@ void Monitor::handle_probe_reply(MonOpRequestRef op)
 
   // end discover phase
   if (!is_probing()) {
-    m->put();
     return;
   }
 
@@ -1700,7 +1690,6 @@ void Monitor::handle_probe_reply(MonOpRequestRef op)
 
   if (is_synchronizing()) {
     dout(10) << " currently syncing" << dendl;
-    m->put();
     return;
   }
 
@@ -1721,7 +1710,6 @@ void Monitor::handle_probe_reply(MonOpRequestRef op)
               << dendl;
       cancel_probe_timeout();
       sync_start(other, true);
-      m->put();
       return;
     }
     if (paxos->get_version() + g_conf->paxos_max_join_drift < m->paxos_last_version) {
@@ -1731,7 +1719,6 @@ void Monitor::handle_probe_reply(MonOpRequestRef op)
               << dendl;
       cancel_probe_timeout();
       sync_start(other, false);
-      m->put();
       return;
     }
   }
@@ -1760,7 +1747,6 @@ void Monitor::handle_probe_reply(MonOpRequestRef op)
       outside_quorum.insert(m->name);
     } else {
       dout(10) << " mostly ignoring mon." << m->name << ", not part of monmap" << dendl;
-      m->put();
       return;
     }
 
@@ -1777,7 +1763,6 @@ void Monitor::handle_probe_reply(MonOpRequestRef op)
       dout(10) << " that's not yet enough for a new quorum, waiting" << dendl;
     }
   }
-  m->put();
 }
 
 void Monitor::join_election()
@@ -2589,8 +2574,6 @@ void Monitor::handle_command(MonOpRequestRef op)
     rs = ss.str();
     if (!m->get_source().is_mon())  // don't reply to mon->mon commands
       reply_command(m, r, rs, 0);
-    else
-      m->put();
     return;
   }
 
@@ -3009,8 +2992,6 @@ void Monitor::handle_command(MonOpRequestRef op)
  out:
   if (!m->get_source().is_mon())  // don't reply to mon->mon commands
     reply_command(m, r, rs, rdata, 0);
-  else
-    m->put();
 }
 
 void Monitor::reply_command(MMonCommand *m, int rc, const string &rs, version_t version)
@@ -3025,7 +3006,6 @@ void Monitor::reply_command(MMonCommand *m, int rc, const string &rs, bufferlist
   reply->set_tid(m->get_tid());
   reply->set_data(rdata);
   send_reply(m, reply);
-  m->put();
 }
 
 
@@ -3162,7 +3142,6 @@ void Monitor::handle_forward(MonOpRequestRef op)
     s->put();
   }
   session->put();
-  m->put();
 }
 
 void Monitor::try_send_message(Message *m, const entity_inst_t& to)
@@ -3240,7 +3219,6 @@ void Monitor::handle_route(MonOpRequestRef op)
     dout(0) << "MRoute received from entity without appropriate perms! "
            << dendl;
     session->put();
-    m->put();
     return;
   }
   if (m->msg)
@@ -3272,7 +3250,6 @@ void Monitor::handle_route(MonOpRequestRef op)
       m->msg = NULL;
     }
   }
-  m->put();
   if (session)
     session->put();
 }
@@ -3376,14 +3353,12 @@ void Monitor::waitlist_or_zap_client(MonOpRequestRef op)
   } else {
     dout(5) << "discarding message " << *m << " and sending client elsewhere" << dendl;
     con->mark_down();
-    m->put();
   }
 }
 
 void Monitor::_ms_dispatch(Message *m)
 {
   if (is_shutdown()) {
-    m->put();
     return;
   }
 
@@ -3462,7 +3437,6 @@ void Monitor::dispatch(MonOpRequestRef op)
   } else {
     dout(20) << "ms_dispatch existing session " << s << " for " << s->inst << dendl;
   }
-  op->set_session(s);
 
   assert(s);
   if (s->auth_handler) {
@@ -3628,7 +3602,6 @@ void Monitor::dispatch_op(MonOpRequestRef op)
        never sent by clients to us. */
     case MSG_LOGACK:
       log_client.handle_log_ack((MLogAck*)op->get_req());
-      //m->put();
       break;
 
     // monmap
@@ -3643,7 +3616,6 @@ void Monitor::dispatch_op(MonOpRequestRef op)
         if (!op->is_src_mon() ||
             !op->get_session()->is_capable("mon", MON_CAP_X)) {
           //can't send these!
-          pm->put();
           break;
         }
 
@@ -3652,18 +3624,15 @@ void Monitor::dispatch_op(MonOpRequestRef op)
           // good, thus just drop them and ignore them.
           dout(10) << __func__ << " ignore paxos msg from "
             << pm->get_source_inst() << dendl;
-          pm->put();
           break;
         }
 
         // sanitize
         if (pm->epoch > get_epoch()) {
           bootstrap();
-          pm->put();
           break;
         }
         if (pm->epoch != get_epoch()) {
-          pm->put();
           break;
         }
 
@@ -3678,7 +3647,6 @@ void Monitor::dispatch_op(MonOpRequestRef op)
           !op->get_session()->is_capable("mon", MON_CAP_X)) {
         dout(0) << "MMonElection received from entity without enough caps!"
           << op->get_session()->caps << dendl;
-        //m->put();
         break;
       }
       if (!is_probing() && !is_synchronizing()) {
@@ -3709,7 +3677,6 @@ void Monitor::dispatch_op(MonOpRequestRef op)
   return;
 
 drop:
-  //m->put();
   return;
 }
 
@@ -3737,7 +3704,6 @@ void Monitor::handle_ping(MonOpRequestRef op)
   reply->set_payload(payload);
   dout(10) << __func__ << " reply payload len " << reply->get_payload().length() << dendl;
   messenger->send_message(reply, inst);
-  m->put();
 }
 
 void Monitor::timecheck_start()
@@ -4112,7 +4078,6 @@ void Monitor::handle_timecheck(MonOpRequestRef op)
   } else {
     dout(1) << __func__ << " drop unexpected msg" << dendl;
   }
-  m->put();
 }
 
 void Monitor::handle_subscribe(MonOpRequestRef op)
@@ -4125,7 +4090,6 @@ void Monitor::handle_subscribe(MonOpRequestRef op)
   MonSession *s = static_cast<MonSession *>(m->get_connection()->get_priv());
   if (!s) {
     dout(10) << " no session, dropping" << dendl;
-    m->put();
     return;
   }
 
@@ -4167,7 +4131,6 @@ void Monitor::handle_subscribe(MonOpRequestRef op)
     m->get_connection()->send_message(new MMonSubscribeAck(monmap->get_fsid(), (int)g_conf->mon_subscribe_interval));
 
   s->put();
-  m->put();
 }
 
 void Monitor::handle_get_version(MonOpRequestRef op)
@@ -4179,7 +4142,6 @@ void Monitor::handle_get_version(MonOpRequestRef op)
   MonSession *s = static_cast<MonSession *>(m->get_connection()->get_priv());
   if (!s) {
     dout(10) << " no session, dropping" << dendl;
-    m->put();
     return;
   }
 
@@ -4214,7 +4176,6 @@ void Monitor::handle_get_version(MonOpRequestRef op)
     m->get_connection()->send_message(reply);
   }
 
-  m->put();
 
  out:
   s->put();
@@ -4287,7 +4248,6 @@ void Monitor::handle_mon_get_map(MonOpRequestRef op)
   MMonGetMap *m = static_cast<MMonGetMap*>(op->get_req());
   dout(10) << "handle_mon_get_map" << dendl;
   send_latest_monmap(m->get_connection().get());
-  m->put();
 }
 
 void Monitor::handle_mon_metadata(MonOpRequestRef op)
@@ -4297,7 +4257,6 @@ void Monitor::handle_mon_metadata(MonOpRequestRef op)
     dout(10) << __func__ << dendl;
     update_mon_metadata(m->get_source().num(), m->data);
   }
-  m->put();
 }
 
 void Monitor::update_mon_metadata(int from, const Metadata& m)
@@ -4494,7 +4453,6 @@ void Monitor::handle_scrub(MonOpRequestRef op)
     }
     break;
   }
-  m->put();
 }
 
 bool Monitor::_scrub(ScrubResult *r,
index 5e26a2fc1be3f9332ebfcef7d8ced48e1a142a05..a5cc6e3582312f68ad333f78438e1519171907d7 100644 (file)
@@ -847,7 +847,7 @@ public:
        mon->reply_command(m, rc, rs, rdata, version);
       }
       else if (r == -ECANCELED)
-       m->put();
+        return;
       else if (r == -EAGAIN)
        mon->dispatch_op(op);
       else
@@ -859,7 +859,6 @@ public:
   class C_RetryMessage : public Context {
     Monitor *mon;
     MonOpRequestRef op;
-    Message *msg;
   public:
     C_RetryMessage(Monitor *m, MonOpRequestRef o) : mon(m), op(o) {}
     void finish(int r) {
index c204447361e9492f80b4b9cad1ee20c30c7f18da..03d58745c8c63dd6fc4b62134450582b0cef2a06 100644 (file)
@@ -137,7 +137,6 @@ bool MonmapMonitor::preprocess_query(MonOpRequestRef op)
     return preprocess_join(op);
   default:
     assert(0);
-    m->put();
     return true;
   }
 }
@@ -270,7 +269,6 @@ bool MonmapMonitor::prepare_update(MonOpRequestRef op)
     return prepare_join(op);
   default:
     assert(0);
-    m->put();
   }
 
   return false;
@@ -400,18 +398,15 @@ bool MonmapMonitor::preprocess_join(MonOpRequestRef op)
   if (!session ||
       !session->is_capable("mon", MON_CAP_W | MON_CAP_X)) {
     dout(10) << " insufficient caps" << dendl;
-    join->put();
     return true;
   }
 
   if (pending_map.contains(join->name) && !pending_map.get_addr(join->name).is_blank_ip()) {
     dout(10) << " already have " << join->name << dendl;
-    join->put();
     return true;
   }
   if (pending_map.contains(join->addr) && pending_map.get_name(join->addr) == join->name) {
     dout(10) << " already have " << join->addr << dendl;
-    join->put();
     return true;
   }
   return false;
@@ -426,7 +421,6 @@ bool MonmapMonitor::prepare_join(MonOpRequestRef op)
     pending_map.remove(pending_map.get_name(join->addr));
   pending_map.add(join->name, join->addr);
   pending_map.last_changed = ceph_clock_now(g_ceph_context);
-  join->put();
   return true;
 }
 
index a0abbee38b9a07e474ff385f776afc706e820bca..9166fd4f0ba739f556ea4a54329f90f31ed700bf 100644 (file)
@@ -1285,7 +1285,6 @@ bool OSDMonitor::preprocess_query(MonOpRequestRef op)
 
   default:
     assert(0);
-    m->put();
     return true;
   }
 }
@@ -1319,7 +1318,6 @@ bool OSDMonitor::prepare_update(MonOpRequestRef op)
 
   default:
     assert(0);
-    m->put();
   }
 
   return false;
@@ -1374,7 +1372,6 @@ bool OSDMonitor::preprocess_get_osdmap(MonOpRequestRef op)
   reply->oldest_map = get_first_committed();
   reply->newest_map = osdmap.get_epoch();
   mon->send_reply(m, reply);
-  m->put();
   return true;
 }
 
@@ -1459,7 +1456,6 @@ bool OSDMonitor::preprocess_failure(MonOpRequestRef op)
   return false;
 
  didit:
-  m->put();
   return true;
 }
 
@@ -1483,7 +1479,6 @@ public:
        false));   // ACK itself does not request an ack
   }
   ~C_AckMarkedDown() {
-    m->put();
   }
 };
 
@@ -1740,7 +1735,6 @@ bool OSDMonitor::prepare_failure(MonOpRequestRef op)
       dout(10) << " no failure_info for osd." << target_osd << dendl;
     }
     mon->no_reply(m);
-    m->put();
   }
 
   return false;
@@ -1866,7 +1860,6 @@ bool OSDMonitor::preprocess_boot(MonOpRequestRef op)
   return false;
 
  ignore:
-  m->put();
   return true;
 }
 
@@ -1885,7 +1878,6 @@ bool OSDMonitor::prepare_boot(MonOpRequestRef op)
   // does this osd exist?
   if (from >= osdmap.get_max_osd()) {
     dout(1) << "boot from osd." << from << " >= max_osd " << osdmap.get_max_osd() << dendl;
-    m->put();
     return false;
   }
 
@@ -2058,7 +2050,6 @@ bool OSDMonitor::preprocess_alive(MonOpRequestRef op)
   return false;
 
  ignore:
-  m->put();
   return true;
 }
 
@@ -2158,7 +2149,6 @@ bool OSDMonitor::preprocess_pgtemp(MonOpRequestRef op)
   return true;
 
  ignore:
-  m->put();
   return true;
 }
 
@@ -2229,7 +2219,6 @@ bool OSDMonitor::preprocess_remove_snaps(MonOpRequestRef op)
   }
 
  ignore:
-  m->put();
   return true;
 }
 
@@ -2260,8 +2249,6 @@ bool OSDMonitor::prepare_remove_snaps(MonOpRequestRef op)
       }
     }
   }
-
-  m->put();
   return true;
 }
 
@@ -2277,7 +2264,6 @@ void OSDMonitor::send_latest(PaxosServiceMessage *m, epoch_t start)
     send_full(m);
   else
     send_incremental(m, start);
-  m->put();
 }
 
 
@@ -7538,5 +7524,4 @@ void OSDMonitor::_pool_op_reply(MonOpRequestRef op,
   MPoolOpReply *reply = new MPoolOpReply(m->fsid, m->get_tid(),
                                         ret, epoch, get_last_committed(), blp);
   mon->send_reply(m, reply);
-  m->put();
 }
index bc5ffb522d7bd00ae43a88fc5094129677938e85..4be9b06413c966b901fcf6922a640bb4d43fbebb 100644 (file)
@@ -334,7 +334,6 @@ private:
   struct C_Booted : public Context {
     OSDMonitor *cmon;
     MonOpRequestRef op;
-    // MOSDBoot *m;
     bool logit;
     C_Booted(OSDMonitor *cm, MonOpRequestRef op_, bool l=true) : 
       cmon(cm), op(op_), logit(l) {}
@@ -343,10 +342,8 @@ private:
        cmon->_booted(op, logit);
       else if (r == -ECANCELED)
         return;
-//     m->put();
       else if (r == -EAGAIN)
         cmon->dispatch(op);
-//     cmon->dispatch((PaxosServiceMessage*)m);
       else
        assert(0 == "bad C_Booted return value");
     }
@@ -355,7 +352,6 @@ private:
   struct C_ReplyMap : public Context {
     OSDMonitor *osdmon;
     MonOpRequestRef op;
-//    PaxosServiceMessage *m;
     epoch_t e;
     C_ReplyMap(OSDMonitor *o, MonOpRequestRef op_, epoch_t ee)
       : osdmon(o), op(op_), e(ee) {}
@@ -364,7 +360,6 @@ private:
        osdmon->_reply_map(op, e);
       else if (r == -ECANCELED)
         return;
-       //m->put();
       else if (r == -EAGAIN)
        osdmon->dispatch(op);
       else
@@ -374,7 +369,6 @@ private:
   struct C_PoolOp : public Context {
     OSDMonitor *osdmon;
     MonOpRequestRef op;
-//    MPoolOp *m;
     int replyCode;
     int epoch;
     bufferlist reply_data;
@@ -388,7 +382,6 @@ private:
        osdmon->_pool_op_reply(op, replyCode, epoch, &reply_data);
       else if (r == -ECANCELED)
         return;
-       //m->put();
       else if (r == -EAGAIN)
        osdmon->dispatch(op);
       else
index 9f6aa9c55765fc9599902dd48b5112400bce7993..cf94e33ef7a854bbaf864290eada57645a99841d 100644 (file)
@@ -595,7 +595,6 @@ bool PGMonitor::preprocess_query(MonOpRequestRef op)
 
   default:
     assert(0);
-    m->put();
     return true;
   }
 }
@@ -613,7 +612,6 @@ bool PGMonitor::prepare_update(MonOpRequestRef op)
 
   default:
     assert(0);
-    m->put();
     return false;
   }
 }
@@ -624,11 +622,11 @@ void PGMonitor::handle_statfs(MonOpRequestRef op)
   // check caps
   MonSession *session = statfs->get_session();
   if (!session)
-    goto out;
+    return;
   if (!session->is_capable("pg", MON_CAP_R)) {
     dout(0) << "MStatfs received from entity with insufficient privileges "
            << session->caps << dendl;
-    goto out;
+    return;
   }
   MStatfsReply *reply;
 
@@ -636,7 +634,7 @@ void PGMonitor::handle_statfs(MonOpRequestRef op)
 
   if (statfs->fsid != mon->monmap->fsid) {
     dout(0) << "handle_statfs on fsid " << statfs->fsid << " != " << mon->monmap->fsid << dendl;
-    goto out;
+    return;
   }
 
   // fill out stfs
@@ -650,8 +648,6 @@ void PGMonitor::handle_statfs(MonOpRequestRef op)
 
   // reply
   mon->send_reply(statfs, reply);
- out:
-  statfs->put();
 }
 
 bool PGMonitor::preprocess_getpoolstats(MonOpRequestRef op)
@@ -689,7 +685,6 @@ bool PGMonitor::preprocess_getpoolstats(MonOpRequestRef op)
   mon->send_reply(m, reply);
 
  out:
-  m->put();
   return true;
 }
 
@@ -701,13 +696,11 @@ bool PGMonitor::preprocess_pg_stats(MonOpRequestRef op)
   MonSession *session = stats->get_session();
   if (!session) {
     dout(10) << "PGMonitor::preprocess_pg_stats: no monitor session!" << dendl;
-    stats->put();
     return true;
   }
   if (!session->is_capable("pg", MON_CAP_R)) {
     derr << "PGMonitor::preprocess_pg_stats: MPGStats received from entity "
          << "with insufficient privileges " << session->caps << dendl;
-    stats->put();
     return true;
   }
 
@@ -755,7 +748,6 @@ bool PGMonitor::prepare_pg_stats(MonOpRequestRef op)
 
   if (stats->fsid != mon->monmap->fsid) {
     dout(0) << "prepare_pg_stats on fsid " << stats->fsid << " != " << mon->monmap->fsid << dendl;
-    stats->put();
     return false;
   }
 
@@ -765,7 +757,6 @@ bool PGMonitor::prepare_pg_stats(MonOpRequestRef op)
       !mon->osdmon()->osdmap.is_up(from) ||
       stats->get_orig_source_inst() != mon->osdmon()->osdmap.get_inst(from)) {
     dout(1) << " ignoring stats from non-active osd." << dendl;
-    stats->put();
     return false;
   }
       
@@ -779,7 +770,6 @@ bool PGMonitor::prepare_pg_stats(MonOpRequestRef op)
       ack->pg_stat[p->first] = make_pair(p->second.reported_seq, p->second.reported_epoch);
     }
     mon->send_reply(stats, ack);
-    stats->put();
     return false;
   }
 
@@ -852,7 +842,6 @@ void PGMonitor::_updated_stats(MonOpRequestRef op, MonOpRequestRef ack_op)
   MPGStats *ack = static_cast<MPGStats*>(ack_op->get_req());
   dout(7) << "_updated_stats for " << req->get_orig_source_inst() << dendl;
   mon->send_reply(req, ack);
-  req->put();
 }
 
 
index 80d26f5cecd06835207820d39f53f88978468e4a..7efd8a9fe1d80eaefff133eca9a70be8c504221f 100644 (file)
@@ -86,8 +86,6 @@ private:
     PGMonitor *pgmon;
     MonOpRequestRef stats_op;
     MonOpRequestRef stats_op_ack;
-//    MPGStats *req;
-//    MPGStatsAck *ack;
     entity_inst_t who;
     C_Stats(PGMonitor *p,
             MonOpRequestRef op,
@@ -98,11 +96,8 @@ private:
        pgmon->_updated_stats(stats_op, stats_op_ack);
       } else if (r == -ECANCELED) {
         return;
-//     req->put();
-//     ack->put();
       } else if (r == -EAGAIN) {
        pgmon->dispatch(stats_op);
-//     ack->put();
       } else {
        assert(0 == "bad C_Stats return value");
       }
index 481e8f4ecc0bd6aa1c3631215bb9a7d7eb115860..4141aae954e2133455be0ae9eb1ba390d29fe900 100644 (file)
@@ -207,7 +207,6 @@ void Paxos::handle_collect(MonOpRequestRef op)
             << " leader's lowest version is too high for our last committed"
             << " (theirs: " << collect->first_committed
             << "; ours: " << last_committed << ") -- bootstrap!" << dendl;
-    collect->put();
     mon->bootstrap();
     return;
   }
@@ -287,7 +286,6 @@ void Paxos::handle_collect(MonOpRequestRef op)
 
   // send reply
   collect->get_connection()->send_message(last);
-  collect->put();
 }
 
 /**
@@ -460,7 +458,6 @@ void Paxos::handle_last(MonOpRequestRef op)
 
   if (!mon->is_leader()) {
     dout(10) << "not leader, dropping" << dendl;
-    last->put();
     return;
   }
 
@@ -475,7 +472,6 @@ void Paxos::handle_last(MonOpRequestRef op)
            << " lowest version is too high for our last committed"
             << " (theirs: " << last->first_committed
             << "; ours: " << last_committed << ") -- bootstrap!" << dendl;
-    last->put();
     mon->bootstrap();
     return;
   }
@@ -497,7 +493,6 @@ void Paxos::handle_last(MonOpRequestRef op)
              << " last_committed (" << p->second
              << ") is too low for our first_committed (" << first_committed
              << ") -- bootstrap!" << dendl;
-      last->put();
       mon->bootstrap();
       return;
     }
@@ -582,8 +577,6 @@ void Paxos::handle_last(MonOpRequestRef op)
 
   if (need_refresh)
     (void)do_refresh();
-
-  last->put();
 }
 
 void Paxos::collect_timeout()
@@ -699,7 +692,6 @@ void Paxos::handle_begin(MonOpRequestRef op)
   // can we accept this?
   if (begin->pn < accepted_pn) {
     dout(10) << " we accepted a higher pn " << accepted_pn << ", ignoring" << dendl;
-    begin->put();
     return;
   }
   assert(begin->pn == accepted_pn);
@@ -747,8 +739,6 @@ void Paxos::handle_begin(MonOpRequestRef op)
   accept->pn = accepted_pn;
   accept->last_committed = last_committed;
   begin->get_connection()->send_message(accept);
-  
-  begin->put();
 }
 
 // leader
@@ -761,12 +751,12 @@ void Paxos::handle_accept(MonOpRequestRef op)
   if (accept->pn != accepted_pn) {
     // we accepted a higher pn, from some other leader
     dout(10) << " we accepted a higher pn " << accepted_pn << ", ignoring" << dendl;
-    goto out;
+    return;
   }
   if (last_committed > 0 &&
       accept->last_committed < last_committed-1) {
     dout(10) << " this is from an old round, ignoring" << dendl;
-    goto out;
+    return;
   }
   assert(accept->last_committed == last_committed ||   // not committed
         accept->last_committed == last_committed-1);  // committed
@@ -788,9 +778,6 @@ void Paxos::handle_accept(MonOpRequestRef op)
     dout(10) << " got majority, committing, done with update" << dendl;
     commit_start();
   }
-
- out:
-  accept->put();
 }
 
 void Paxos::accept_timeout()
@@ -931,7 +918,6 @@ void Paxos::handle_commit(MonOpRequestRef op)
   if (!mon->is_peon()) {
     dout(10) << "not a peon, dropping" << dendl;
     assert(0);
-    commit->put();
     return;
   }
 
@@ -940,8 +926,6 @@ void Paxos::handle_commit(MonOpRequestRef op)
   if (do_refresh()) {
     finish_contexts(g_ceph_context, waiting_for_commit);
   }
-
-  commit->put();
 }
 
 void Paxos::extend_lease()
@@ -1074,7 +1058,6 @@ void Paxos::handle_lease(MonOpRequestRef op)
       last_committed != lease->last_committed) {
     dout(10) << "handle_lease i'm not a peon, or they're not the leader,"
             << " or the last_committed doesn't match, dropping" << dendl;
-    lease->put();
     return;
   }
 
@@ -1111,8 +1094,6 @@ void Paxos::handle_lease(MonOpRequestRef op)
   finish_contexts(g_ceph_context, waiting_for_active);
   if (is_readable())
     finish_contexts(g_ceph_context, waiting_for_readable);
-
-  lease->put();
 }
 
 void Paxos::handle_lease_ack(MonOpRequestRef op)
@@ -1147,8 +1128,6 @@ void Paxos::handle_lease_ack(MonOpRequestRef op)
   }
 
   warn_on_future_time(ack->sent_timestamp, ack->get_source());
-
-  ack->put();
 }
 
 void Paxos::lease_ack_timeout()
@@ -1376,7 +1355,6 @@ void Paxos::dispatch(MonOpRequestRef op)
   // election in progress?
   if (!mon->is_leader() && !mon->is_peon()) {
     dout(5) << "election in progress, dropping " << *m << dendl;
-    m->put();
     return;    
   }
 
index 69fa9a5a4fceaf4539c201d1ba6448f090212f88..cfbeb14fba0b811ce821f7ea5bb3d91ae3232449 100644 (file)
@@ -41,7 +41,6 @@ bool PaxosService::dispatch(MonOpRequestRef op)
   dout(10) << "dispatch " << *m << " from " << m->get_orig_source_inst() << dendl;
 
   if (mon->is_shutdown()) {
-    m->put();
     return true;
   }
 
@@ -50,7 +49,6 @@ bool PaxosService::dispatch(MonOpRequestRef op)
       m->rx_election_epoch < mon->get_epoch()) {
     dout(10) << " discarding forwarded message from previous election epoch "
             << m->rx_election_epoch << " < " << mon->get_epoch() << dendl;
-    m->put();
     return true;
   }
 
@@ -63,7 +61,6 @@ bool PaxosService::dispatch(MonOpRequestRef op)
       m->get_connection()->get_messenger() != NULL) {
     dout(10) << " discarding message from disconnected client "
             << m->get_source_inst() << " " << *m << dendl;
-    m->put();
     return true;
   }
 
index b876164b63d96d114df47143ecb6921d53530b83..b6a16db2edf622088c3126c71eac9a3d2fb15c60 100644 (file)
@@ -105,7 +105,6 @@ protected:
   class C_RetryMessage : public Context {
     PaxosService *svc;
     MonOpRequestRef op;
-//    PaxosServiceMessage *m;
   public:
     C_RetryMessage(PaxosService *s, MonOpRequestRef op_) : svc(s), op(op_) {}
     void finish(int r) {
@@ -113,7 +112,6 @@ protected:
        svc->dispatch(op);
       else if (r == -ECANCELED)
         return;
-//     m->put();
       else
        assert(0 == "bad C_RetryMessage return value");
     }