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

Method send_resize_object_map

src/librbd/operation/RebuildObjectMapRequest.cc:99–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97
98template <typename I>
99void RebuildObjectMapRequest<I>::send_resize_object_map() {
100 ceph_assert(ceph_mutex_is_locked(m_image_ctx.owner_lock));
101 CephContext *cct = m_image_ctx.cct;
102
103 m_image_ctx.image_lock.lock_shared();
104 ceph_assert(m_image_ctx.object_map != nullptr);
105
106 uint64_t size = get_image_size();
107 uint64_t num_objects = Striper::get_num_objects(m_image_ctx.layout, size);
108
109 if (m_image_ctx.object_map->size() == num_objects) {
110 m_image_ctx.image_lock.unlock_shared();
111 send_verify_objects();
112 return;
113 }
114
115 ldout(cct, 5) << this << " send_resize_object_map" << dendl;
116 m_state = STATE_RESIZE_OBJECT_MAP;
117
118 // should have been canceled prior to releasing lock
119 ceph_assert(m_image_ctx.exclusive_lock == nullptr ||
120 m_image_ctx.exclusive_lock->is_lock_owner());
121
122 m_image_ctx.object_map->aio_resize(size, OBJECT_NONEXISTENT,
123 this->create_callback_context());
124 m_image_ctx.image_lock.unlock_shared();
125}
126
127template <typename I>
128void RebuildObjectMapRequest<I>::send_trim_image() {

Callers

nothing calls this directly

Calls 7

get_image_sizeFunction · 0.85
aio_resizeMethod · 0.80
lock_sharedMethod · 0.45
sizeMethod · 0.45
unlock_sharedMethod · 0.45
is_lock_ownerMethod · 0.45

Tested by

no test coverage detected