void copy_from(const std::string& src, const IoCtx& src_ioctx,
uint64_t src_version, uint32_t src_fadvise_flags);
+ /**
+ * Copy an object
+ *
+ * Copies an object from another location. The operation is atomic in that
+ * the copy either succeeds in its entirety or fails (e.g., because the
+ * source object was modified while the copy was in progress). Instead of
+ * copying truncate_seq and truncate_size from the source object it receives
+ * these values as parameters.
+ *
+ * @param src source object name
+ * @param src_ioctx ioctx for the source object
+ * @param src_version current version of the source object
+ * @param truncate_seq truncate sequence for the destination object
+ * @param truncate_size truncate size for the destination object
+ * @param src_fadvise_flags the fadvise flags for source object
+ */
+ void copy_from2(const std::string& src, const IoCtx& src_ioctx,
+ uint64_t src_version, uint32_t truncate_seq,
+ uint64_t truncate_size, uint32_t src_fadvise_flags);
+
/**
* undirty an object
*
src_ioctx.io_ctx_impl->oloc, src_version, 0, src_fadvise_flags);
}
+void librados::ObjectWriteOperation::copy_from2(const std::string& src,
+ const IoCtx& src_ioctx,
+ uint64_t src_version,
+ uint32_t truncate_seq,
+ uint64_t truncate_size,
+ uint32_t src_fadvise_flags)
+{
+ ceph_assert(impl);
+ ::ObjectOperation *o = &impl->o;
+ o->copy_from2(object_t(src), src_ioctx.io_ctx_impl->snap_seq,
+ src_ioctx.io_ctx_impl->oloc, src_version, 0,
+ truncate_seq, truncate_size, src_fadvise_flags);
+}
+
void librados::ObjectWriteOperation::undirty()
{
ceph_assert(impl);
encode(src, osd_op.indata);
encode(src_oloc, osd_op.indata);
}
+ void copy_from2(object_t src, snapid_t snapid, object_locator_t src_oloc,
+ version_t src_version, unsigned flags,
+ uint32_t truncate_seq, uint64_t truncate_size,
+ unsigned src_fadvise_flags) {
+ using ceph::encode;
+ OSDOp& osd_op = add_op(CEPH_OSD_OP_COPY_FROM2);
+ osd_op.op.copy_from.snapid = snapid;
+ osd_op.op.copy_from.src_version = src_version;
+ osd_op.op.copy_from.flags = flags;
+ osd_op.op.copy_from.src_fadvise_flags = src_fadvise_flags;
+ encode(src, osd_op.indata);
+ encode(src_oloc, osd_op.indata);
+ encode(truncate_seq, osd_op.indata);
+ encode(truncate_size, osd_op.indata);
+ }
/**
* writeback content to backing tier