mirror of
https://github.com/ceph/ceph
synced 2025-01-03 01:22:53 +00:00
Merge pull request #55281 from Matan-B/wip-matanb-crimson-cyanstore-rmcoll
crimson/os/cyanstore: support OP_RMCOLL Reviewed-by: Samuel Just <sjust@redhat.com> Reviewed-by: chunmei-liu <chunmei.liu@intel.com>
This commit is contained in:
commit
7eb9e33f53
@ -494,6 +494,12 @@ seastar::future<> CyanStore::Shard::do_transaction_no_callbacks(
|
||||
r = _create_collection(cid, op->split_bits);
|
||||
}
|
||||
break;
|
||||
case Transaction::OP_RMCOLL:
|
||||
{
|
||||
coll_t cid = i.get_cid(op->cid);
|
||||
r = _remove_collection(cid);
|
||||
}
|
||||
break;
|
||||
case Transaction::OP_SETALLOCHINT:
|
||||
{
|
||||
r = 0;
|
||||
@ -863,6 +869,17 @@ int CyanStore::Shard::_create_collection(const coll_t& cid, int bits)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CyanStore::Shard::_remove_collection(const coll_t& cid)
|
||||
{
|
||||
logger().debug("{} cid={}", __func__, cid);
|
||||
auto c = _get_collection(cid);
|
||||
if (!c) {
|
||||
return -ENOENT;
|
||||
}
|
||||
coll_map.erase(cid);
|
||||
return 0;
|
||||
}
|
||||
|
||||
boost::intrusive_ptr<Collection>
|
||||
CyanStore::Shard::_get_collection(const coll_t& cid)
|
||||
{
|
||||
|
@ -148,6 +148,7 @@ class CyanStore final : public FuturizedStore {
|
||||
std::string_view name);
|
||||
int _rm_attrs(const coll_t& cid, const ghobject_t& oid);
|
||||
int _create_collection(const coll_t& cid, int bits);
|
||||
int _remove_collection(const coll_t& cid);
|
||||
boost::intrusive_ptr<Collection> _get_collection(const coll_t& cid);
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user