Signed-off-by: Sage Weil <sage@inktank.com>
tctx->new_snapset.head_exists = true;
dout(20) << __func__ << " new_snapset " << tctx->new_snapset << dendl;
- // take RWWRITE lock for duration of our local write
- if (!obc->rwstate.get_write_lock()) {
+ // take RWWRITE lock for duration of our local write. ignore starvation.
+ if (!obc->rwstate.take_write_lock()) {
assert(0 == "problem!");
}
tctx->lock_to_release = OpContext::W_LOCK;
return false;
}
}
+ /// same as get_write_lock, but ignore starvation
+ bool take_write_lock() {
+ if (state == RWWRITE) {
+ count++;
+ return true;
+ }
+ return get_write_lock();
+ }
void dec(list<OpRequestRef> *requeue) {
assert(count > 0);
assert(requeue);