From: Greg Farnum Date: Fri, 4 Oct 2013 20:30:46 +0000 (-0700) Subject: ReplicatedPG: copy: do not let start_copy() return error codes X-Git-Tag: v0.72-rc1~13^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4e139fc318a5a6918cdf03db4b8685c67ff0a9dd;p=ceph.git ReplicatedPG: copy: do not let start_copy() return error codes There's no failure it can actually run into, and handling error codes in some of its callers is going to be a pain. While we're here, document the parameters. Signed-off-by: Greg Farnum --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index fd4ffb77485..a9e3c557d92 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -3717,10 +3717,8 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& ops) 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 @@ -4322,7 +4320,7 @@ struct C_Copyfrom : public Context { } }; -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) { @@ -4344,8 +4342,6 @@ int ReplicatedPG::start_copy(CopyCallback *cb, ObjectContextRef obc, ++obc->copyfrom_readside; _copy_some(obc, cop); - - return 0; } void ReplicatedPG::_copy_some(ObjectContextRef obc, CopyOpRef cop) diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index 00216170516..8aa36be5ef4 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -974,7 +974,17 @@ protected: // -- copyfrom -- map 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);