diff options
author | Greg Farnum <greg@inktank.com> | 2013-10-04 13:30:46 -0700 |
---|---|---|
committer | Greg Farnum <greg@inktank.com> | 2013-10-08 15:45:56 -0700 |
commit | 7a4eba05e4e8946ad2e0e2cf621ac51ad0aab558 (patch) | |
tree | 8e88d16c1a12fb345ead30dbb2f0a3911e1328a8 | |
parent | 8e493ef23b1a70e19aaee63f656706d2aa004068 (diff) | |
download | ceph-7a4eba05e4e8946ad2e0e2cf621ac51ad0aab558.tar.gz |
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 <greg@inktank.com>
-rw-r--r-- | src/osd/ReplicatedPG.cc | 8 | ||||
-rw-r--r-- | src/osd/ReplicatedPG.h | 12 |
2 files changed, 13 insertions, 7 deletions
diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index f466eb8ccdc..cb39889d614 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -3707,10 +3707,8 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& 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 @@ -4312,7 +4310,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) { @@ -4334,8 +4332,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 27c9d1bb605..13c91df3d7d 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -808,7 +808,17 @@ protected: // -- 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); |