Block any request on an object (read or write) during the COPY_FROM
operation.
This could potentially be broken down into read vs write operations without
much difficulty, but blocking any op indescriminately is sufficient for
now, so let's keep it simple.
Signed-off-by: Sage Weil <sage@inktank.com>
if (r < 0) {
copy_ops.erase(ctx->obc->obs.oi.soid);
--ctx->obc->copyfrom_readside;
+ kick_object_context_blocked(ctx->obc);
reply_ctx(ctx, r);
return;
}
copy_ops.erase(ctx->obc->obs.oi.soid);
--ctx->obc->copyfrom_readside;
ctx->copy_op.reset();
+ kick_object_context_blocked(ctx->obc);
}
void ReplicatedPG::_write_copy_chunk(CopyOpRef cop, ObjectStore::Transaction *t)
--ctx->obc->copyfrom_readside;
ctx->copy_op.reset();
+ kick_object_context_blocked(ctx->obc);
+
delete ctx;
}
}
bool is_blocked() const {
- return false;
+ return copyfrom_readside > 0;
}
// do simple synchronous mutual exclusion, for now. now waitqueues or anything fancy.