]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: fix up _closed_mds_session
authorSage Weil <sage@inktank.com>
Fri, 8 Mar 2013 21:05:22 +0000 (13:05 -0800)
committerSage Weil <sage@inktank.com>
Wed, 13 Mar 2013 23:36:56 +0000 (16:36 -0700)
Drop useless arg.  Simplify callers.

Signed-off-by: Sage Weil <sage@inktank.com>
src/client/Client.cc
src/client/Client.h
src/client/MetaSession.cc
src/client/MetaSession.h

index ab26adf6541abbac8686a495450732b6121e5650..a368a093052cbd64a643b54f9f6d9956d6c3a264 100644 (file)
@@ -1488,14 +1488,14 @@ void Client::_close_mds_session(MetaSession *s)
                          s->inst);
 }
 
-void Client::_closed_mds_session(int mds, MetaSession *s)
+void Client::_closed_mds_session(MetaSession *s)
 {
+  s->state = MetaSession::STATE_CLOSED;
   mount_cond.Signal();
-  if (s)
-    remove_session_caps(s);
-  kick_requests(mds, true);
+  remove_session_caps(s);
+  kick_requests(s->mds_num, true);
+  mds_sessions.erase(s->mds_num);
   delete s;
-  mds_sessions.erase(mds);
 }
 
 void Client::handle_client_session(MClientSession *m) 
@@ -1522,7 +1522,7 @@ void Client::handle_client_session(MClientSession *m)
     break;
 
   case CEPH_SESSION_CLOSE:
-    _closed_mds_session(from, session);
+    _closed_mds_session(session);
     break;
 
   case CEPH_SESSION_RENEWCAPS:
@@ -7769,7 +7769,7 @@ void Client::ms_handle_remote_reset(Connection *con)
       if (mds >= 0) {
        if (s->state == MetaSession::STATE_CLOSING) {
          ldout(cct, 1) << "reset from mds we were closing; we'll call that closed" << dendl;
-         _closed_mds_session(mds, s);
+         _closed_mds_session(s);
        }
       }
     }
index cbd10a28cd8e21af2ace8eff32b12f1ffe5c5bf4..069c1fb54a5d043ea6c2709f595129280b2fe36c 100644 (file)
@@ -236,7 +236,7 @@ public:
   MetaSession *_get_or_open_mds_session(int mds);
   MetaSession *_open_mds_session(int mds);
   void _close_mds_session(MetaSession *s);
-  void _closed_mds_session(int mds, MetaSession *s);
+  void _closed_mds_session(MetaSession *s);
   void handle_client_session(MClientSession *m);
   void send_reconnect(int mds);
   void resend_unsafe_requests(int mds);
index c6a9496710b5b5686ae4a50f8ecdab5fe50ed452..87c14bf11f64825f86347d9ac49692e775d9b110 100644 (file)
@@ -14,6 +14,7 @@ const char *MetaSession::get_state_name() const
   case STATE_OPENING: return "opening";
   case STATE_OPEN: return "open";
   case STATE_CLOSING: return "closing";
+  case STATE_CLOSED: return "closed";
   default: return "unknown";
   }
 }
index bb3fad241a0d1ffbe800da2aae5de84f24c3939e..ab015a17bc4310bd2f1a1c2acf88237c9d3ce3cb 100644 (file)
@@ -33,6 +33,7 @@ struct MetaSession {
     STATE_OPENING,
     STATE_OPEN,
     STATE_CLOSING,
+    STATE_CLOSED,
   } state;
 
   list<Cond*> waiting_for_open;