From: Sage Weil Date: Wed, 20 May 2020 18:31:38 +0000 (-0500) Subject: ceph-dedup-tool: make --add-chunk-ref use get_ref (not read_refs + set_refs) X-Git-Tag: v17.0.0~2135^2~17 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b831bb2b7185c49058c8c57e620702d1e2332be6;p=ceph.git ceph-dedup-tool: make --add-chunk-ref use get_ref (not read_refs + set_refs) Signed-off-by: Sage Weil --- diff --git a/src/tools/ceph_dedup_tool.cc b/src/tools/ceph_dedup_tool.cc index bef1a5eb1bc7e..fb459dbecb28b 100644 --- a/src/tools/ceph_dedup_tool.cc +++ b/src/tools/ceph_dedup_tool.cc @@ -777,26 +777,15 @@ int chunk_scrub_common(const std::map < std::string, std::string > &opts, exit(1); } - set refs; - ret = cls_cas_chunk_read_refs(chunk_io_ctx, object_name, &refs); - if (ret < 0) { - cerr << " cls_cas_chunk_read fail : " << cpp_strerror(ret) << std::endl; - return ret; - } - for (auto p : refs) { - cout << " " << p.oid.name << " "; - } - uint32_t hash; ret = chunk_io_ctx.get_object_hash_position2(object_name, &hash); if (ret < 0) { return ret; } hobject_t oid(sobject_t(target_object_name, CEPH_NOSNAP), "", hash, pool_id, ""); - refs.insert(oid); ObjectWriteOperation op; - cls_cas_chunk_set_refs(op, refs); + cls_cas_chunk_get_ref(op, oid); ret = chunk_io_ctx.operate(object_name, &op); if (ret < 0) { cerr << " operate fail : " << cpp_strerror(ret) << std::endl;