| 186 | |
| 187 | template <typename I> |
| 188 | void MigrateRequest<I>::migrate_objects() { |
| 189 | I &image_ctx = this->m_image_ctx; |
| 190 | CephContext *cct = image_ctx.cct; |
| 191 | ceph_assert(ceph_mutex_is_locked(image_ctx.owner_lock)); |
| 192 | |
| 193 | uint64_t overlap_objects = get_num_overlap_objects(); |
| 194 | |
| 195 | ldout(cct, 10) << "from 0 to " << overlap_objects << dendl; |
| 196 | |
| 197 | auto ctx = create_context_callback< |
| 198 | MigrateRequest<I>, &MigrateRequest<I>::handle_migrate_objects>(this); |
| 199 | |
| 200 | typename AsyncObjectThrottle<I>::ContextFactory context_factory( |
| 201 | boost::lambda::bind(boost::lambda::new_ptr<C_MigrateObject<I> >(), |
| 202 | boost::lambda::_1, &image_ctx, image_ctx.get_data_io_context(), |
| 203 | boost::lambda::_2)); |
| 204 | AsyncObjectThrottle<I> *throttle = new AsyncObjectThrottle<I>( |
| 205 | this, image_ctx, context_factory, ctx, &m_prog_ctx, 0, overlap_objects); |
| 206 | throttle->start_ops( |
| 207 | image_ctx.config.template get_val<uint64_t>("rbd_concurrent_management_ops")); |
| 208 | } |
| 209 | |
| 210 | template <typename I> |
| 211 | void MigrateRequest<I>::handle_migrate_objects(int r) { |
nothing calls this directly
no test coverage detected