Our OpSequencer may live longer than the ObjectStore::Sequencer interface
object does.
Signed-off-by: Sage Weil <sage@redhat.com>
* even though fsyncs will complete in any order.
*/
- OpSequencer *osr = txc->osr;
+ OpSequencer *osr = txc->osr.get();
Mutex::Locker l(osr->qlock);
txc->state = TransContext::STATE_FSYNC_DONE;
txc->removed_collections.pop_front();
}
- OpSequencer *osr = txc->osr;
+ OpSequencerRef osr = txc->osr;
osr->qlock.Lock();
txc->state = TransContext::STATE_DONE;
osr->qlock.Unlock();
- _osr_reap_done(osr);
+ _osr_reap_done(osr.get());
}
void NewStore::_osr_reap_done(OpSequencer *osr)
};
class OpSequencer;
+ typedef boost::intrusive_ptr<OpSequencer> OpSequencerRef;
struct fsync_item {
boost::intrusive::list_member_hook<> queue_item;
return "???";
}
- OpSequencer *osr;
+ OpSequencerRef osr;
boost::intrusive::list_member_hook<> sequencer_item;
list<fsync_item> fds; ///< these fds need to be synced
o->put();
}
+static inline void intrusive_ptr_add_ref(NewStore::OpSequencer *o) {
+ o->get();
+}
+static inline void intrusive_ptr_release(NewStore::OpSequencer *o) {
+ o->put();
+}
+
#endif