include/denc: replace bufferlist::copy with iterator version

This version was only compiled as part of ceph-object-corpus
generation, when ENCODE_DUMP_PATH is defined, so it was missed
when bufferlist::copy() was removed.

Fixes: https://tracker.ceph.com/issues/45023
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
This commit is contained in:
Josh Durgin 2020-04-15 21:26:40 -04:00
parent 61ad12e6ad
commit 06e862bc68

View File

@ -124,7 +124,7 @@ private:
auto close_fd = make_scope_guard([fd] { ::close(fd); });
if (auto bl_delta = appender.bl.length() - bl_offset; bl_delta > 0) {
ceph::bufferlist dump_bl;
appender.bl.copy(bl_offset + space_offset, bl_delta - space_offset, dump_bl);
appender.bl.begin(bl_offset + space_offset).copy(bl_delta - space_offset, dump_bl);
const size_t space_len = space_size();
dump_bl.append(appender.get_pos() - space_len, space_len);
dump_bl.write_fd(fd);