From: Sage Weil Date: Wed, 10 Feb 2016 22:51:18 +0000 (-0500) Subject: buffer: alloc right-sized buffer from read_fd X-Git-Tag: v10.1.0~245^2~4 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=ce3e5a334798a6eff8b4cb99d99b6efc00531f97;p=ceph-ci.git buffer: alloc right-sized buffer from read_fd This may as well fit the input; this doesn't relate to the append buffer. Signed-off-by: Sage Weil --- diff --git a/src/common/buffer.cc b/src/common/buffer.cc index b42f72685bc..188ef72af24 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -2012,8 +2012,7 @@ ssize_t buffer::list::read_fd(int fd, size_t len) // available for raw_pipe until we actually inspect the data return 0; } - int s = ROUND_UP_TO(len, CEPH_BUFFER_APPEND_SIZE); - bufferptr bp = buffer::create_aligned(s, CEPH_BUFFER_APPEND_SIZE); + bufferptr bp = buffer::create(len); ssize_t ret = safe_read(fd, (void*)bp.c_str(), len); if (ret >= 0) { bp.set_length(ret);