From: Samuel Just Date: Wed, 10 Jul 2024 22:53:28 +0000 (-0700) Subject: crimson/.../alien_store: update coll_map from alien tp X-Git-Tag: v20.0.0~1426^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e2b75b56010cf555a0237f90c9dc6e5eebbc7b04;p=ceph.git crimson/.../alien_store: update coll_map from alien tp Signed-off-by: Samuel Just --- diff --git a/src/crimson/os/alienstore/alien_store.cc b/src/crimson/os/alienstore/alien_store.cc index b908bebe3437..362b3a2700e8 100644 --- a/src/crimson/os/alienstore/alien_store.cc +++ b/src/crimson/os/alienstore/alien_store.cc @@ -233,12 +233,9 @@ seastar::future 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( - 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 AlienStore::open_collection(const coll_t& cid) @@ -246,13 +243,12 @@ seastar::future 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(); + return CollectionRef{}; + } else { + return get_alien_coll_ref(std::move(c)); } - return seastar::make_ready_future( - get_alien_coll_ref(std::move(c))); }); } diff --git a/src/crimson/os/alienstore/alien_store.h b/src/crimson/os/alienstore/alien_store.h index f679c9718919..ef464743c7e5 100644 --- a/src/crimson/os/alienstore/alien_store.h +++ b/src/crimson/os/alienstore/alien_store.h @@ -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_map; CollectionRef get_alien_coll_ref(ObjectStore::CollectionHandle c);