]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: use op's get_session() instead of getting from connection
authorJoao Eduardo Luis <joao@suse.de>
Wed, 17 Jun 2015 15:07:37 +0000 (16:07 +0100)
committerJoao Eduardo Luis <joao@suse.de>
Thu, 16 Jul 2015 17:31:22 +0000 (18:31 +0100)
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
src/mon/AuthMonitor.cc
src/mon/Monitor.cc
src/mon/Monitor.h

index 35c63b0a28667b70fef2a10f072cabaa97a6946b..24cacb31a4da05f1c983c5decd103cefcc9fc068 100644 (file)
@@ -358,7 +358,7 @@ bool AuthMonitor::prep_auth(MonOpRequestRef op, bool paxos_writable)
   MAuth *m = static_cast<MAuth*>(op->get_req());
   dout(10) << "prep_auth() blob_size=" << m->get_auth_payload().length() << dendl;
 
-  MonSession *s = (MonSession *)m->get_connection()->get_priv();
+  MonSession *s = op->get_session();
   if (!s) {
     dout(10) << "no session, dropping" << dendl;
     return true;
index 008250efcd7cab0b08f06d2ef46f717ad3af5352..87e865686b52db5b4ecbc9c756d4403958b7d0ae 100644 (file)
@@ -3116,7 +3116,7 @@ void Monitor::handle_forward(MonOpRequestRef op)
   MForward *m = static_cast<MForward*>(op->get_req());
   dout(10) << "received forwarded message from " << m->client
           << " via " << m->get_source_inst() << dendl;
-  MonSession *session = static_cast<MonSession *>(m->get_connection()->get_priv());
+  MonSession *session = op->get_session();
   assert(session);
 
   if (!session->is_capable("mon", MON_CAP_X)) {
@@ -3249,7 +3249,7 @@ void Monitor::no_reply(PaxosServiceMessage *req)
 void Monitor::handle_route(MonOpRequestRef op)
 {
   MRoute *m = static_cast<MRoute*>(op->get_req());
-  MonSession *session = static_cast<MonSession *>(m->get_connection()->get_priv());
+  MonSession *session = op->get_session();
   //check privileges
   if (session && !session->is_capable("mon", MON_CAP_X)) {
     dout(0) << "MRoute received from entity without appropriate perms! "
@@ -3419,7 +3419,7 @@ void Monitor::dispatch(MonOpRequestRef op)
 
   bool reuse_caps = false;
   dout(20) << "have connection" << dendl;
-  s = static_cast<MonSession *>(connection->get_priv());
+  s = op->get_session();
   if (s && s->closed) {
     caps = s->caps;
     reuse_caps = true;
@@ -4127,7 +4127,7 @@ void Monitor::handle_subscribe(MonOpRequestRef op)
   
   bool reply = false;
 
-  MonSession *s = static_cast<MonSession *>(m->get_connection()->get_priv());
+  MonSession *s = op->get_session();
   if (!s) {
     dout(10) << " no session, dropping" << dendl;
     return;
@@ -4179,7 +4179,7 @@ void Monitor::handle_get_version(MonOpRequestRef op)
   dout(10) << "handle_get_version " << *m << dendl;
   PaxosService *svc = NULL;
 
-  MonSession *s = static_cast<MonSession *>(m->get_connection()->get_priv());
+  MonSession *s = op->get_session();
   if (!s) {
     dout(10) << " no session, dropping" << dendl;
     return;
index e5a5d6cde948052dd31f9ebf714cad1603a28a68..cf4e160b3aecd732b9d8a0cdb2549dc3e02cbb51 100644 (file)
@@ -834,7 +834,7 @@ public:
         if (!op->get_req()->get_connection()) {
           ss << "connection dropped for command ";
         } else {
-          MonSession *s = m->get_session();
+          MonSession *s = op->get_session();
 
           // if client drops we may not have a session to draw information from.
           if (s) {