return clean;
}
+bool ObjectCacher::_flush_set_finish(C_GatherBuilder *gather, Context *onfinish)
+{
+ assert(lock.is_locked());
+ if (gather->has_subs()) {
+ gather->set_finisher(onfinish);
+ gather->activate();
+ return false;
+ }
+
+ ldout(cct, 10) << "flush_set has no dirty|tx bhs" << dendl;
+ onfinish->complete(0);
+ return true;
+}
+
// flush. non-blocking, takes callback.
// returns true if already flushed
bool ObjectCacher::flush_set(ObjectSet *oset, Context *onfinish)
}
}
- if (gather.has_subs()) {
- gather.set_finisher(onfinish);
- gather.activate();
- return false;
- } else {
- ldout(cct, 10) << "flush_set " << oset << " has no dirty|tx bhs" << dendl;
- onfinish->complete(0);
- return true;
- }
+ return _flush_set_finish(&gather, onfinish);
}
// flush. non-blocking, takes callback.
return true;
}
- ldout(cct, 10) << "flush_set " << oset << " on " << exv.size() << " ObjectExtents" << dendl;
+ ldout(cct, 10) << "flush_set " << oset << " on " << exv.size()
+ << " ObjectExtents" << dendl;
// we'll need to wait for all objects to flush!
C_GatherBuilder gather(cct);
}
}
- if (gather.has_subs()) {
- gather.set_finisher(onfinish);
- gather.activate();
- return false;
- } else {
- ldout(cct, 10) << "flush_set " << oset << " has no dirty|tx bhs" << dendl;
- onfinish->complete(0);
- return true;
- }
+ return _flush_set_finish(&gather, onfinish);
}
void ObjectCacher::purge_set(ObjectSet *oset)
int _wait_for_write(OSDWrite *wr, uint64_t len, ObjectSet *oset, Mutex& lock,
Context *onfreespace);
void maybe_wait_for_writeback(uint64_t len);
+ bool _flush_set_finish(C_GatherBuilder *gather, Context *onfinish);
public:
bool set_is_cached(ObjectSet *oset);