]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/.../alien_store: update coll_map from alien tp
authorSamuel Just <sjust@redhat.com>
Wed, 10 Jul 2024 22:53:28 +0000 (15:53 -0700)
committerSamuel Just <sjust@redhat.com>
Tue, 23 Jul 2024 18:01:24 +0000 (18:01 +0000)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/os/alienstore/alien_store.cc
src/crimson/os/alienstore/alien_store.h

index b908bebe3437b1510b42556a0c0100621ce8eecb..362b3a2700e8af544f4a999f1aab1ded64af06e4 100644 (file)
@@ -233,12 +233,9 @@ seastar::future<CollectionRef> AlienStore::create_new_collection(const coll_t& c
   logger().debug("{}", __func__);
   assert(tp);
   return tp->submit([this, cid] {
-    return store->create_new_collection(cid);
-  }).then([this, cid] (ObjectStore::CollectionHandle c) {
-    return seastar::make_ready_future<CollectionRef>(
-      get_alien_coll_ref(std::move(c)));
+    ObjectStore::CollectionHandle c = store->create_new_collection(cid);
+    return get_alien_coll_ref(std::move(c));
   });
-
 }
 
 seastar::future<CollectionRef> AlienStore::open_collection(const coll_t& cid)
@@ -246,13 +243,12 @@ seastar::future<CollectionRef> AlienStore::open_collection(const coll_t& cid)
   logger().debug("{}", __func__);
   assert(tp);
   return tp->submit([this, cid] {
-    return store->open_collection(cid);
-  }).then([this] (ObjectStore::CollectionHandle c) {
+    ObjectStore::CollectionHandle c = store->open_collection(cid);
     if (!c) {
-      return seastar::make_ready_future<CollectionRef>();
+      return CollectionRef{};
+    } else {
+      return get_alien_coll_ref(std::move(c));
     }
-    return seastar::make_ready_future<CollectionRef>(
-      get_alien_coll_ref(std::move(c)));
   });
 }
 
index f679c9718919e947b5226b8ddd6dbff4cf1b412c..ef464743c7e5fe160c8d0c9b6450370ae7fcfce2 100644 (file)
@@ -148,6 +148,8 @@ private:
    *    instance to the alien thread pool to be released.
    * 2. OSD shutdown needs to *guarantee* that all outstanding CollectionRefs
    *    are released before unmounting and stopping the store.
+   *
+   * coll_map is accessed exclusively from alien threadpool threads.
    */
   std::unordered_map<coll_t, CollectionRef> coll_map;
   CollectionRef get_alien_coll_ref(ObjectStore::CollectionHandle c);