]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/cyanstore: support OP_RMCOLL 55281/head
authorMatan Breizman <mbreizma@redhat.com>
Tue, 23 Jan 2024 12:18:05 +0000 (12:18 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Thu, 25 Jan 2024 15:33:45 +0000 (15:33 +0000)
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/crimson/os/cyanstore/cyan_store.cc
src/crimson/os/cyanstore/cyan_store.h

index f2a6018e36abc4b2c4f7563bd377a552fbe0c5a5..36230893d36baace0d1689ffc8197cf3c1030d60 100644 (file)
@@ -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)
 {
index 307f9ec32eda511d85492c24c4df52eec607986b..518222d82f65129791ac9739ea5748179959e592 100644 (file)
@@ -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: