#include "common/sharedptr_registry.hpp"
#include "common/errno.h"
#include "osd/HitSet.h"
+#include "common/ceph_crypto.h"
#ifndef RADOSMODEL_H
#define RADOSMODEL_H
if (src_value.version != 0 && !src_value.deleted())
op.assert_version(src_value.version);
+
+ string target_oid;
+ if (!oid_tgt.empty()) {
+ target_oid = oid_tgt;
+ } else {
+ bufferlist bl;
+ int r = context->io_ctx.read(context->prefix+oid, bl, offset, length);
+ ceph_assert(r > 0);
+ string fp_oid = ceph::crypto::digest<ceph::crypto::SHA256>(bl).to_str();
+ r = context->low_tier_io_ctx.write(fp_oid, bl, bl.length(), 0);
+ ceph_assert(r == 0);
+ target_oid = fp_oid;
+ tgt_offset = 0;
+ }
+
+ cout << num << ": target oid " << target_oid << " offset " << tgt_offset << std::endl;
+
op.set_chunk(offset, length, context->low_tier_io_ctx,
- context->prefix+oid_tgt, tgt_offset, CEPH_OSD_OP_FLAG_WITH_REFERENCE);
+ context->prefix+target_oid, tgt_offset, CEPH_OSD_OP_FLAG_WITH_REFERENCE);
pair<TestOp*, TestOp::CallbackInfo*> *cb_arg =
new pair<TestOp*, TestOp::CallbackInfo*>(this,
{
ceph_assert(m_enable_dedup);
oid = *(rand_choose(context.oid_not_in_use));
- /* The intention here is to mark the source object as a manifest object */
- oid2 = *(rand_choose(context.oid_set_chunk_tgt_pool));
uint32_t rand_offset = 0, rand_length = 0;
get_rand_off_len(context, oid, rand_offset, rand_length);
cout << m_op << ": " << "set_chunk oid " << oid << " offset: " << rand_offset
- << " length: " << rand_length << " target oid " << oid2
+ << " length: " << rand_length << " target oid " << ""
<< " tgt_offset: " << rand_offset << std::endl;
- return new SetChunkOp(m_op, &context, oid, rand_offset, rand_length, oid2, rand_offset, m_stats);
+ return new SetChunkOp(m_op, &context, oid, rand_offset, rand_length, "", rand_offset, m_stats);
}
case TEST_OP_TIER_EVICT: