]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: copy: do not let start_copy() return error codes
authorGreg Farnum <greg@inktank.com>
Fri, 4 Oct 2013 20:30:46 +0000 (13:30 -0700)
committerGreg Farnum <greg@inktank.com>
Fri, 25 Oct 2013 20:36:44 +0000 (13:36 -0700)
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>
src/osd/ReplicatedPG.cc
src/osd/ReplicatedPG.h

index fd4ffb77485b62746b7f270bc6c16e05fd6336b0..a9e3c557d929e94e123ee821e11963a375d24fe5 100644 (file)
@@ -3717,10 +3717,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
@@ -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)
index 00216170516979a7ebc1e5ef6c2292a8110f3457..8aa36be5ef435c61664d8febceaa001ba8f5341f 100644 (file)
@@ -974,7 +974,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);