hobject_t temp_target = generate_temp_object();
CopyFromCallback *cb = new CopyFromCallback(ctx, temp_target);
ctx->copy_cb = cb;
- result = start_copy(cb, ctx->obc, src, src_oloc, src_version,
+ start_copy(cb, ctx->obc, src, src_oloc, src_version,
temp_target);
- if (result < 0)
- goto fail;
result = -EINPROGRESS;
} else {
// finish
}
};
-int ReplicatedPG::start_copy(CopyCallback *cb, ObjectContextRef obc,
+void ReplicatedPG::start_copy(CopyCallback *cb, ObjectContextRef obc,
hobject_t src, object_locator_t oloc, version_t version,
const hobject_t& temp_dest_oid)
{
++obc->copyfrom_readside;
_copy_some(obc, cop);
-
- return 0;
}
void ReplicatedPG::_copy_some(ObjectContextRef obc, CopyOpRef cop)
// -- copyfrom --
map<hobject_t, CopyOpRef> copy_ops;
- int start_copy(CopyCallback *cb, ObjectContextRef obc, hobject_t src,
+ /**
+ * To copy an object, call start_copy.
+ *
+ * @param cb: The CopyCallback to be activated when the copy is complete
+ * @param obc: The ObjectContext we are copying into
+ * @param src: The source object
+ * @param oloc: the source object locator
+ * @param version: the version of the source object to copy (0 for any)
+ * @param temp_dest_oid: the temporary object to use for large objects
+ */
+ void start_copy(CopyCallback *cb, ObjectContextRef obc, hobject_t src,
object_locator_t oloc, version_t version,
const hobject_t& temp_dest_oid);
void process_copy_chunk(hobject_t oid, tid_t tid, int r);