boost::lambda::_1, &m_image_ctx, m_object_size, m_snapc,
boost::lambda::_2));
AsyncObjectThrottle *throttle = new AsyncObjectThrottle(
- *this, context_factory, create_callback_context(), &m_prog_ctx, 0,
+ this, context_factory, create_callback_context(), &m_prog_ctx, 0,
m_overlap_objects);
throttle->start_ops(m_image_ctx.concurrent_management_ops);
}
namespace librbd
{
-AsyncObjectThrottle::AsyncObjectThrottle(const AsyncRequest& async_request,
+AsyncObjectThrottle::AsyncObjectThrottle(const AsyncRequest* async_request,
const ContextFactory& context_factory,
Context *ctx, ProgressContext *prog_ctx,
uint64_t object_no,
void AsyncObjectThrottle::start_next_op() {
bool done = false;
while (!done) {
- if (m_async_request.is_canceled() && m_ret == 0) {
+ if (m_async_request != NULL && m_async_request->is_canceled() &&
+ m_ret == 0) {
// allow in-flight ops to complete, but don't start new ops
m_ret = -ERESTART;
return;
typedef boost::function<C_AsyncObjectThrottle*(AsyncObjectThrottle&,
uint64_t)> ContextFactory;
- AsyncObjectThrottle(const AsyncRequest &async_request,
+ AsyncObjectThrottle(const AsyncRequest *async_request,
const ContextFactory& context_factory, Context *ctx,
ProgressContext *prog_ctx, uint64_t object_no,
uint64_t end_object_no);
private:
Mutex m_lock;
- const AsyncRequest &m_async_request;
+ const AsyncRequest *m_async_request;
ContextFactory m_context_factory;
Context *m_ctx;
ProgressContext *m_prog_ctx;
boost::lambda::bind(boost::lambda::new_ptr<AsyncTrimObjectContext>(),
boost::lambda::_1, &m_image_ctx, boost::lambda::_2));
AsyncObjectThrottle *throttle = new AsyncObjectThrottle(
- *this, context_factory, ctx, &m_prog_ctx, m_delete_start, m_num_objects);
+ this, context_factory, ctx, &m_prog_ctx, m_delete_start, m_num_objects);
throttle->start_ops(m_image_ctx.concurrent_management_ops);
}
boost::lambda::bind(boost::lambda::new_ptr<C_VerifyObject>(),
boost::lambda::_1, &m_image_ctx, snap_id, boost::lambda::_2));
AsyncObjectThrottle *throttle = new AsyncObjectThrottle(
- *this, context_factory, create_callback_context(), &m_prog_ctx, 0,
+ this, context_factory, create_callback_context(), &m_prog_ctx, 0,
num_objects);
throttle->start_ops(cct->_conf->rbd_concurrent_management_ops);
}