From: weixinwei Date: Fri, 19 Feb 2021 13:40:19 +0000 (+0800) Subject: librbd: memory is not preallocated in rbd c++ read api X-Git-Tag: v17.1.0~2915^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F39573%2Fhead;p=ceph.git librbd: memory is not preallocated in rbd c++ read api Signed-off-by: weixinwei --- diff --git a/src/librbd/librbd.cc b/src/librbd/librbd.cc index f099143d2460..a803b7db7f25 100644 --- a/src/librbd/librbd.cc +++ b/src/librbd/librbd.cc @@ -2475,8 +2475,6 @@ namespace librbd { { ImageCtx *ictx = (ImageCtx *)ctx; tracepoint(librbd, read_enter, ictx, ictx->name.c_str(), ictx->snap_name.c_str(), ictx->read_only, ofs, len); - bufferptr ptr(len); - bl.push_back(std::move(ptr)); int r = api::Io<>::read(*ictx, ofs, len, io::ReadResult{&bl}, 0); tracepoint(librbd, read_exit, r); @@ -2488,8 +2486,6 @@ namespace librbd { ImageCtx *ictx = (ImageCtx *)ctx; tracepoint(librbd, read2_enter, ictx, ictx->name.c_str(), ictx->snap_name.c_str(), ictx->read_only, ofs, len, op_flags); - bufferptr ptr(len); - bl.push_back(std::move(ptr)); int r = api::Io<>::read(*ictx, ofs, len, io::ReadResult{&bl}, op_flags); tracepoint(librbd, read_exit, r);