From: Radoslaw Zarzynski Date: Mon, 8 Oct 2018 10:14:21 +0000 (+0200) Subject: os: Transaction::_update_op_bl doesn't copy bl::_buffers anymore. X-Git-Tag: v14.1.0~721^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2f441edd68945ade915b77a58d601c7e41a21afc;p=ceph.git os: Transaction::_update_op_bl doesn't copy bl::_buffers anymore. Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/os/ObjectStore.h b/src/os/ObjectStore.h index dc426aca292..9810c9630aa 100644 --- a/src/os/ObjectStore.h +++ b/src/os/ObjectStore.h @@ -695,15 +695,11 @@ public: bufferlist& bl, vector<__le32> &cm, vector<__le32> &om) { + for (auto& bp : bl.buffers()) { + ceph_assert(bp.length() % sizeof(Op) == 0); - ceph::bufferlist::buffers_t list = bl.buffers(); - ceph::bufferlist::buffers_t::iterator p; - - for(p = list.begin(); p != list.end(); ++p) { - ceph_assert(p->length() % sizeof(Op) == 0); - - char* raw_p = p->c_str(); - char* raw_end = raw_p + p->length(); + char* raw_p = const_cast(bp.c_str()); + char* raw_end = raw_p + bp.length(); while (raw_p < raw_end) { _update_op(reinterpret_cast(raw_p), cm, om); raw_p += sizeof(Op);