p++) {
PG *pg = p->second;
pg->lock();
- pg->put_unlock();
+ pg->unlock();
+ pg->put();
}
pg_map.clear();
pg_map.erase(pgid);
// unlock, and probably delete
- pg->put_unlock(); // will delete, if last reference
+ pg->unlock();
+ pg->put(); // will delete, if last reference
dout(10) << "_remove_unlock_pg " << pgid << " done" << dendl;
}
if (started < max)
pg->recovery_item.remove_myself();
- pg->put_unlock();
+ pg->unlock();
+ pg->put();
}
assert(0);
// unlock and put pg
- pg->put_unlock();
+ pg->unlock();
+ pg->put();
//#warning foo
//scrub_wq.queue(pg);
void _clear() {
while (!osd->recovery_queue.empty()) {
PG *pg = osd->recovery_queue.front();
- pg->lock();
- pg->put_unlock();
osd->recovery_queue.pop_front();
+ pg->put();
}
}
} recovery_wq;
void _clear() {
while (!osd->snap_trim_queue.empty()) {
PG *pg = osd->snap_trim_queue.front();
- pg->lock();
- pg->put_unlock();
osd->snap_trim_queue.pop_front();
+ pg->put();
}
}
} snap_trim_wq;
pg->scrub();
}
void _clear() {
- while (!osd->scrub_queue.empty()) {
+ while (!osd->scrub_queue.empty()) {
PG *pg = osd->scrub_queue.front();
- pg->lock();
- pg->put_unlock();
osd->scrub_queue.pop_front();
+ pg->put();
}
}
} scrub_wq;
}
osd->map_lock.put_read();
osd->finish_recovery_op(this, recovery_ops_active, true);
- put_unlock();
+ unlock();
+ put();
}
void PG::defer_recovery()
void put() {
//generic_dout(0) << this << " " << info.pgid << " put " << ref.test() << dendl;
assert(_lock.is_locked());
- ref.dec();
- assert(ref.test() > 0); // last put must be a put_unlock.
- }
- void put_unlock() {
- //generic_dout(0) << this << " " << info.pgid << " put_unlock " << ref.test() << dendl;
- assert(_lock.is_locked());
- int last = ref.dec();
- _lock.Unlock();
- if (last == 0) delete this;
+ if (ref.dec() == 0)
+ delete this;
}
if (!pg->is_deleted())
pg->op_modify_ondisk(repop);
repop->put();
- pg->put_unlock();
+ pg->unlock();
+ pg->put();
}
};
pg->lock();
pg->sub_op_modify_ondisk(op, destosd, pg_last_complete);
- pg->put_unlock();
+ pg->unlock();
+ pg->put();
}
void ack() {
lock.Lock();