]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/Transaction: add omap_rmkey
authorSage Weil <sage@redhat.com>
Mon, 13 Jan 2020 13:51:56 +0000 (07:51 -0600)
committerKefu Chai <kchai@redhat.com>
Tue, 14 Jan 2020 06:25:20 +0000 (14:25 +0800)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/Transaction.h

index f74f19d2c8b7a5e2f6328594fce7408f42c2650d..3b8eb1bb2f54134376c660dfad1d15cab51d1611 100644 (file)
@@ -1119,6 +1119,22 @@ public:
     data.ops = data.ops + 1;
   }
 
+  /// Remove key from oid omap
+  void omap_rmkey(
+    const coll_t &cid,             ///< [in] Collection containing oid
+    const ghobject_t &oid,  ///< [in] Object from which to remove the omap
+    const std::string& key ///< [in] Keys to clear
+    ) {
+    Op* _op = _get_next_op();
+    _op->op = OP_OMAP_RMKEYS;
+    _op->cid = _get_coll_id(cid);
+    _op->oid = _get_object_id(oid);
+    using ceph::encode;
+    encode((uint32_t)1, data_bl);
+    encode(key, data_bl);
+    data.ops = data.ops + 1;
+  }
+
   /// Remove keys from oid omap
   void omap_rmkeys(
     const coll_t &cid,             ///< [in] Collection containing oid