]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: memory is not preallocated in rbd c++ read api 39573/head
authorweixinwei <weixw3@lenovo.com>
Fri, 19 Feb 2021 13:40:19 +0000 (21:40 +0800)
committerweixinwei <weixw3@lenovo.com>
Fri, 19 Feb 2021 13:40:19 +0000 (21:40 +0800)
Signed-off-by: weixinwei <weixw3@lenovo.com>
src/librbd/librbd.cc

index f099143d24600ce33981a34eec54c338570442d0..a803b7db7f25e108d1b7222d04c2a922fae07b5c 100644 (file)
@@ -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);