From ce3e5a334798a6eff8b4cb99d99b6efc00531f97 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 10 Feb 2016 17:51:18 -0500 Subject: [PATCH] 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 --- src/common/buffer.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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); -- 2.39.5