diff options
author | Ilya Dryomov <idryomov@gmail.com> | 2024-01-04 11:44:46 +0100 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2024-01-20 16:06:54 +0100 |
commit | 232ad1a5fb6248d7b3fbfaec5944a90a71a95806 (patch) | |
tree | 1fdefb1764c9433867b5c22f8f01ab263a2ad1a8 /src | |
parent | librbd/object_map: don't resize object map in handle_load_object_map() (diff) | |
download | ceph-232ad1a5fb6248d7b3fbfaec5944a90a71a95806.tar.xz ceph-232ad1a5fb6248d7b3fbfaec5944a90a71a95806.zip |
librbd/object_map: make object map in handle_load_object_map() local
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/librbd/object_map/DiffRequest.cc | 15 | ||||
-rw-r--r-- | src/librbd/object_map/DiffRequest.h | 2 |
2 files changed, 8 insertions, 9 deletions
diff --git a/src/librbd/object_map/DiffRequest.cc b/src/librbd/object_map/DiffRequest.cc index 0d33078c173..abb5353b0c1 100644 --- a/src/librbd/object_map/DiffRequest.cc +++ b/src/librbd/object_map/DiffRequest.cc @@ -185,13 +185,14 @@ void DiffRequest<I>::handle_load_object_map(int r) { auto cct = m_image_ctx->cct; ldout(cct, 10) << "r=" << r << dendl; + BitVector<2> object_map; + std::string oid(ObjectMap<>::object_map_name(m_image_ctx->id, + m_current_snap_id)); + if (r == 0) { auto bl_it = m_out_bl.cbegin(); - r = cls_client::object_map_load_finish(&bl_it, &m_object_map); + r = cls_client::object_map_load_finish(&bl_it, &object_map); } - - std::string oid(ObjectMap<>::object_map_name(m_image_ctx->id, - m_current_snap_id)); if (r == -ENOENT && m_ignore_enoent) { ldout(cct, 10) << "object map " << oid << " does not exist" << dendl; @@ -207,9 +208,9 @@ void DiffRequest<I>::handle_load_object_map(int r) { uint64_t num_objs = Striper::get_num_objects(m_image_ctx->layout, m_current_size); - if (m_object_map.size() < num_objs) { + if (object_map.size() < num_objs) { ldout(cct, 1) << "object map too small: " - << m_object_map.size() << " < " << num_objs << dendl; + << object_map.size() << " < " << num_objs << dendl; finish(-EINVAL); return; } @@ -237,7 +238,7 @@ void DiffRequest<I>::handle_load_object_map(int r) { uint64_t overlap = std::min(m_object_diff_state->size(), prev_object_diff_state_size); - auto it = m_object_map.begin() + start_object_no; + auto it = object_map.begin() + start_object_no; auto diff_it = m_object_diff_state->begin(); uint64_t ono = start_object_no; for (; ono < start_object_no + overlap; ++diff_it, ++ono) { diff --git a/src/librbd/object_map/DiffRequest.h b/src/librbd/object_map/DiffRequest.h index 6a8ecb9dc93..84211c6fc4a 100644 --- a/src/librbd/object_map/DiffRequest.h +++ b/src/librbd/object_map/DiffRequest.h @@ -68,8 +68,6 @@ private: uint64_t m_current_size = 0; - BitVector<2> m_object_map; - bufferlist m_out_bl; bool is_diff_iterate() const; |