Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osd: use append(bufferlist &) to avoid unnecessary copy #12272

Merged
merged 1 commit into from Apr 21, 2017

Conversation

Projects
None yet
3 participants
@wwformat
Copy link
Contributor

wwformat commented Dec 2, 2016

buffer::list::c_str() will rebuild itself if it isn't
contiguous, and append(char *) will do copy from the ptr.

Signed-off-by: Yunchuan Wen yunchuan.wen@kylin-cloud.com

@@ -3904,7 +3904,7 @@ int ReplicatedPG::do_writesame(OpContext *ctx, OSDOp& osd_op)
}

while (write_length) {
write_op.indata.append(osd_op.indata.c_str(), op.writesame.data_length);
write_op.indata.append(osd_op.indata);

This comment has been minimized.

Copy link
@tchaikov

tchaikov Dec 7, 2016

Contributor

on client side Objecter::prepare_writesame_op(), we can assume that they are equal. but can we assert op.indata.length() == op.writesame.data_length on server side?

This comment has been minimized.

Copy link
@wwformat

wwformat Dec 7, 2016

Author Contributor

Before this line, there is:

   if (op.writesame.data_length != osd_op.indata.length()) {
     derr << "invalid length ws data length " << op.writesame.data_length << " actual len " << osd_op.indata.length() << dendl;
     return -EINVAL;
   }

@tchaikov tchaikov self-assigned this Apr 10, 2017

@tchaikov

This comment has been minimized.

Copy link
Contributor

tchaikov commented Apr 14, 2017

@wwformat could you rebase it?

Yunchuan Wen
osd: use append(bufferlist &) to avoid unnecessary copy
buffer::list::c_str() will rebuild itself if it isn't
contiguous, and append(char *) will do copy from the ptr.

Signed-off-by: Yunchuan Wen <yunchuan.wen@kylin-cloud.com>

@wwformat wwformat force-pushed the kylinstorage:wip-writesame branch from b7b00d2 to 87ff240 Apr 18, 2017

@wwformat

This comment has been minimized.

Copy link
Contributor Author

wwformat commented Apr 18, 2017

@wwformat could you rebase it?

@tchaikov ok, already updated.

@tchaikov tchaikov added the needs-qa label Apr 18, 2017

@liewegas liewegas merged commit 93f6c04 into ceph:master Apr 21, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.