Skip to content

Commit e2b75b5

Browse files
committed
crimson/.../alien_store: update coll_map from alien tp
Signed-off-by: Samuel Just <[email protected]>
1 parent 618bef5 commit e2b75b5

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/crimson/os/alienstore/alien_store.cc

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -233,26 +233,22 @@ seastar::future<CollectionRef> AlienStore::create_new_collection(const coll_t& c
233233
logger().debug("{}", __func__);
234234
assert(tp);
235235
return tp->submit([this, cid] {
236-
return store->create_new_collection(cid);
237-
}).then([this, cid] (ObjectStore::CollectionHandle c) {
238-
return seastar::make_ready_future<CollectionRef>(
239-
get_alien_coll_ref(std::move(c)));
236+
ObjectStore::CollectionHandle c = store->create_new_collection(cid);
237+
return get_alien_coll_ref(std::move(c));
240238
});
241-
242239
}
243240

244241
seastar::future<CollectionRef> AlienStore::open_collection(const coll_t& cid)
245242
{
246243
logger().debug("{}", __func__);
247244
assert(tp);
248245
return tp->submit([this, cid] {
249-
return store->open_collection(cid);
250-
}).then([this] (ObjectStore::CollectionHandle c) {
246+
ObjectStore::CollectionHandle c = store->open_collection(cid);
251247
if (!c) {
252-
return seastar::make_ready_future<CollectionRef>();
248+
return CollectionRef{};
249+
} else {
250+
return get_alien_coll_ref(std::move(c));
253251
}
254-
return seastar::make_ready_future<CollectionRef>(
255-
get_alien_coll_ref(std::move(c)));
256252
});
257253
}
258254

src/crimson/os/alienstore/alien_store.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ class AlienStore final : public FuturizedStore,
148148
* instance to the alien thread pool to be released.
149149
* 2. OSD shutdown needs to *guarantee* that all outstanding CollectionRefs
150150
* are released before unmounting and stopping the store.
151+
*
152+
* coll_map is accessed exclusively from alien threadpool threads.
151153
*/
152154
std::unordered_map<coll_t, CollectionRef> coll_map;
153155
CollectionRef get_alien_coll_ref(ObjectStore::CollectionHandle c);

0 commit comments

Comments
 (0)