From: Radoslaw Zarzynski Date: Mon, 4 Mar 2019 00:51:57 +0000 (+0100) Subject: msg/async, v2: drop alloc_aligned_buffer(). X-Git-Tag: v14.1.1~70^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=fdcf7d3be80baf81ccd508971affdfd54bc8661b;p=ceph-ci.git msg/async, v2: drop alloc_aligned_buffer(). Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/msg/async/ProtocolV2.cc b/src/msg/async/ProtocolV2.cc index ff5cff1686f..6235dbe8e4a 100644 --- a/src/msg/async/ProtocolV2.cc +++ b/src/msg/async/ProtocolV2.cc @@ -72,24 +72,6 @@ if(connection->interceptor) { \ #define INTERCEPT(S) #endif -static void alloc_aligned_buffer(bufferlist &data, unsigned len, unsigned off) -{ - // create a buffer to read into that matches the data alignment - unsigned alloc_len = 0; - unsigned left = len; - unsigned head = 0; - if (off & ~CEPH_PAGE_MASK) { - // head - alloc_len += CEPH_PAGE_SIZE; - head = std::min(CEPH_PAGE_SIZE - (off & ~CEPH_PAGE_MASK), left); - left -= head; - } - alloc_len += left; - bufferptr ptr(buffer::create_small_page_aligned(alloc_len)); - if (head) ptr.set_offset(CEPH_PAGE_SIZE - head); - data.push_back(std::move(ptr)); -} - ProtocolV2::ProtocolV2(AsyncConnection *connection) : Protocol(2, connection), temp_buffer(nullptr),