bool ObjectCacher::flush_set(ObjectSet *oset, Context *onfinish)
{
assert(lock.is_locked());
+ assert(onfinish != NULL);
if (oset->objects.empty()) {
ldout(cct, 10) << "flush_set on " << oset << " dne" << dendl;
onfinish->complete(0);
<< ob->last_write_tid
<< " on " << *ob
<< dendl;
- if (onfinish != NULL)
- ob->waitfor_commit[ob->last_write_tid].push_back(gather.new_sub());
+ ob->waitfor_commit[ob->last_write_tid].push_back(gather.new_sub());
}
}
if (gather.has_subs())
gather.set_finisher(onfinish);
- if (onfinish != NULL)
- gather.activate();
+ gather.activate();
if (safe) {
ldout(cct, 10) << "flush_set " << oset << " has no dirty|tx bhs" << dendl;
bool ObjectCacher::flush_set(ObjectSet *oset, vector<ObjectExtent>& exv, Context *onfinish)
{
assert(lock.is_locked());
+ assert(onfinish != NULL);
if (oset->objects.empty()) {
ldout(cct, 10) << "flush_set on " << oset << " dne" << dendl;
onfinish->complete(0);
ldout(cct, 10) << "flush_set " << oset << " will wait for ack tid "
<< ob->last_write_tid << " on " << *ob << dendl;
- if (onfinish != NULL)
- ob->waitfor_commit[ob->last_write_tid].push_back(gather.new_sub());
+ ob->waitfor_commit[ob->last_write_tid].push_back(gather.new_sub());
}
}
if (gather.has_subs())
gather.set_finisher(onfinish);
- if (onfinish != NULL)
- gather.activate();
-
+ gather.activate();
+
if (safe) {
ldout(cct, 10) << "flush_set " << oset << " has no dirty|tx bhs" << dendl;
onfinish->complete(0);