]> 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)
committerYehuda Sadeh <yehuda@redhat.com>
Thu, 29 Sep 2016 21:07:14 +0000 (14:07 -0700)
Don't read the entire range from source object, read it in parts.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_op.cc

index a844fc9bbbc9c98b48757f6fefa5a08bef85e2bb..37f419197b04c210084dd7fef433733fa915f558 100644 (file)
@@ -2730,7 +2730,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;
 }
@@ -2839,7 +2839,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();