| 97 | |
| 98 | template <typename I> |
| 99 | void 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 | |
| 127 | template <typename I> |
| 128 | void RebuildObjectMapRequest<I>::send_trim_image() { |
nothing calls this directly
no test coverage detected