]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/mds/SessionMap.h
import 14.2.4 nautilus point release
[ceph.git] / ceph / src / mds / SessionMap.h
index d9b2104d27df6a177ff955b9f9286dffd14ba46d..8d3c9cc3eea051d005333b7f94d03d2edb54476b 100644 (file)
@@ -300,13 +300,19 @@ public:
   void touch_cap(Capability *cap) {
     caps.push_front(&cap->item_session_caps);
   }
+
   void touch_cap_bottom(Capability *cap) {
     caps.push_back(&cap->item_session_caps);
   }
+
   void touch_lease(ClientLease *r) {
     leases.push_back(&r->item_session_lease);
   }
 
+  bool is_any_flush_waiter() {
+    return !waitfor_flush.empty();
+  }
+
   // -- leases --
   uint32_t lease_seq = 0;
 
@@ -656,21 +662,6 @@ public:
     get_client_sessions(f);
   }
 
-  void replay_open_sessions(map<client_t,entity_inst_t>& client_map,
-                           map<client_t,client_metadata_t>& client_metadata_map) {
-    for (map<client_t,entity_inst_t>::iterator p = client_map.begin(); 
-        p != client_map.end(); 
-        ++p) {
-      Session *s = get_or_add_session(p->second);
-      auto q = client_metadata_map.find(p->first);
-      if (q != client_metadata_map.end())
-       s->info.client_metadata.merge(q->second);
-
-      set_state(s, Session::STATE_OPEN);
-      replay_dirty_session(s);
-    }
-  }
-
   // helpers
   entity_inst_t& get_inst(entity_name_t w) {
     ceph_assert(session_map.count(w));
@@ -718,7 +709,7 @@ protected:
   std::set<entity_name_t> dirty_sessions;
   std::set<entity_name_t> null_sessions;
   bool loaded_legacy = false;
-  void _mark_dirty(Session *session);
+  void _mark_dirty(Session *session, bool may_save);
 public:
 
   /**
@@ -729,7 +720,7 @@ public:
    * to the backing store.  Must have called
    * mark_projected previously for this session.
    */
-  void mark_dirty(Session *session);
+  void mark_dirty(Session *session, bool may_save=true);
 
   /**
    * Advance the projected version, and mark this
@@ -757,6 +748,14 @@ public:
    */
   void replay_advance_version();
 
+  /**
+   * During replay, open sessions, advance versions and
+   * mark these sessions as dirty.
+   */
+  void replay_open_sessions(version_t event_cmapv,
+                           map<client_t,entity_inst_t>& client_map,
+                           map<client_t,client_metadata_t>& client_metadata_map);
+
   /**
    * For these session IDs, if a session exists with this ID, and it has
    * dirty completed_requests, then persist it immediately