MCPcopy Create free account
hub / github.com/ceph/ceph / update_object_map

Function update_object_map

src/librbd/operation/RebuildObjectMapRequest.cc:156–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154
155template <typename I>
156bool update_object_map(I& image_ctx, uint64_t object_no, uint8_t current_state,
157 uint8_t new_state) {
158 CephContext *cct = image_ctx.cct;
159 uint64_t snap_id = image_ctx.snap_id;
160
161 current_state = (*image_ctx.object_map)[object_no];
162 if (current_state == OBJECT_EXISTS && new_state == OBJECT_NONEXISTENT &&
163 snap_id == CEPH_NOSNAP) {
164 // might be writing object to OSD concurrently
165 new_state = current_state;
166 }
167
168 if (new_state != current_state) {
169 ldout(cct, 15) << image_ctx.get_object_name(object_no)
170 << " rebuild updating object map "
171 << static_cast<uint32_t>(current_state) << "->"
172 << static_cast<uint32_t>(new_state) << dendl;
173 image_ctx.object_map->set_state(object_no, new_state, current_state);
174 }
175 return false;
176}
177
178template <typename I>
179void RebuildObjectMapRequest<I>::send_verify_objects() {

Callers 4

sendMethod · 0.85
should_completeMethod · 0.85

Calls 2

get_object_nameMethod · 0.45
set_stateMethod · 0.45

Tested by

no test coverage detected