]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: multipart copy part, chunked read
authorYehuda Sadeh <yehuda@redhat.com>
Thu, 29 Sep 2016 21:07:14 +0000 (14:07 -0700)
committerMatt Benjamin <mbenjamin@redhat.com>
Thu, 26 Jan 2017 21:50:29 +0000 (16:50 -0500)
Don't read the entire range from source object, read it in parts.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
(cherry picked from commit 4049e47a0cfc1eef6efd502590b68ba7234589d3)

src/rgw/rgw_op.cc

index 3cce989aa18f11a30ea60523169718c31cccca4b..a61258cb950865ea85ab6fc1c98358a2dab5a82a 100644 (file)
@@ -2468,7 +2468,7 @@ int RGWPutObj::get_data(const off_t fst, const off_t lst, bufferlist& bl)
     return ret;
   }
 
-  bl_aux.copy(0, bl_aux.length(), bl);
+  bl.claim_append(bl_aux);
 
   return ret;
 }
@@ -2576,7 +2576,8 @@ void RGWPutObj::execute()
     if (!copy_source) {
       len = get_data(data_in);
     } else {
-      op_ret = get_data(fst, lst, data_in);
+      uint64_t cur_lst = min(fst + s->cct->_conf->rgw_max_chunk_size - 1, lst);
+      op_ret = get_data(fst, cur_lst, data_in);
       if (op_ret < 0)
         goto done;
       len = data_in.length();