From: Yehuda Sadeh Date: Thu, 29 Sep 2016 21:07:14 +0000 (-0700) Subject: rgw: multipart copy part, chunked read X-Git-Tag: v10.2.6~141^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e5ac1204c26a26b29b146d350ff5034bfd9fc798;p=ceph.git rgw: multipart copy part, chunked read Don't read the entire range from source object, read it in parts. Signed-off-by: Yehuda Sadeh (cherry picked from commit 4049e47a0cfc1eef6efd502590b68ba7234589d3) --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 3cce989aa18f..a61258cb9508 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -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();