| 28 | |
| 29 | template <typename T> |
| 30 | void AsyncObjectThrottle<T>::start_ops(uint64_t max_concurrent) { |
| 31 | ceph_assert(ceph_mutex_is_locked(m_image_ctx.owner_lock)); |
| 32 | bool complete; |
| 33 | { |
| 34 | std::lock_guard l{m_lock}; |
| 35 | for (uint64_t i = 0; i < max_concurrent; ++i) { |
| 36 | start_next_op(); |
| 37 | if (m_ret < 0 && m_current_ops == 0) { |
| 38 | break; |
| 39 | } |
| 40 | } |
| 41 | complete = (m_current_ops == 0); |
| 42 | } |
| 43 | if (complete) { |
| 44 | // avoid re-entrant callback |
| 45 | m_image_ctx.op_work_queue->queue(m_ctx, m_ret); |
| 46 | delete this; |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | template <typename T> |
| 51 | void AsyncObjectThrottle<T>::finish_op(int r) { |
no test coverage detected