| 31 | |
| 32 | template <typename I> |
| 33 | void RemoveRequest<I>::send_remove_object_map() { |
| 34 | CephContext *cct = m_image_ctx->cct; |
| 35 | ldout(cct, 20) << __func__ << dendl; |
| 36 | |
| 37 | std::unique_lock image_locker{m_image_ctx->image_lock}; |
| 38 | std::vector<uint64_t> snap_ids; |
| 39 | snap_ids.push_back(CEPH_NOSNAP); |
| 40 | for (auto it : m_image_ctx->snap_info) { |
| 41 | snap_ids.push_back(it.first); |
| 42 | } |
| 43 | |
| 44 | std::lock_guard locker{m_lock}; |
| 45 | ceph_assert(m_ref_counter == 0); |
| 46 | |
| 47 | for (auto snap_id : snap_ids) { |
| 48 | m_ref_counter++; |
| 49 | std::string oid(ObjectMap<>::object_map_name(m_image_ctx->id, snap_id)); |
| 50 | using klass = RemoveRequest<I>; |
| 51 | librados::AioCompletion *comp = |
| 52 | create_rados_callback<klass, &klass::handle_remove_object_map>(this); |
| 53 | |
| 54 | int r = m_image_ctx->md_ctx.aio_remove(oid, comp); |
| 55 | ceph_assert(r == 0); |
| 56 | comp->release(); |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | template <typename I> |
| 61 | Context *RemoveRequest<I>::handle_remove_object_map(int *result) { |
nothing calls this directly
no test coverage detected