]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/mds/SimpleLock.cc
import 15.2.2 octopus source
[ceph.git] / ceph / src / mds / SimpleLock.cc
index 1f3b732169b7b751faeb71854075a67f7ce60811..7c447419bb6ee0c5a45c0cf0f760a18672b0d791 100644 (file)
@@ -95,12 +95,14 @@ void SimpleLock::remove_cache(MDLockCacheItem& item) {
   }
 }
 
-MDLockCache* SimpleLock::get_first_cache() {
+std::vector<MDLockCache*> SimpleLock::get_active_caches() {
+  std::vector<MDLockCache*> result;
   if (have_more()) {
-    auto& lock_caches = more()->lock_caches;
-    if (!lock_caches.empty()) {
-      return lock_caches.front()->parent;
+    for (auto it = more()->lock_caches.begin_use_current(); !it.end(); ++it) {
+      auto lock_cache = (*it)->parent;
+      if (!lock_cache->invalidating)
+       result.push_back(lock_cache);
     }
   }
-  return nullptr;
+  return result;
 }