Skip to content

Commit

Permalink
rgw: multipart copy part, chunked read
Browse files Browse the repository at this point in the history
Don't read the entire range from source object, read it in parts.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
  • Loading branch information
yehudasa committed Sep 29, 2016
1 parent 8a7ebee commit 4049e47
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/rgw/rgw_op.cc
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 4049e47

Please sign in to comment.