So that callers on the read side can optionally
do their own write_head calls according to
the same condition that Journaler uses
internally for its write_head during _flush() condition.
Signed-off-by: John Spray <john.spray@redhat.com>
}
// write head?
- if (last_wrote_head + seconds(cct->_conf->journaler_write_head_interval)
- < ceph::real_clock::now()) {
+ if (_write_head_needed()) {
_write_head();
}
}
+bool Journaler::_write_head_needed()
+{
+ return last_wrote_head + seconds(cct->_conf->journaler_write_head_interval)
+ < ceph::real_clock::now();
+}
+
/*************** prezeroing ******************/
trimming_pos = trimmed_pos = p;
}
+ bool _write_head_needed();
+ bool write_head_needed() {
+ lock_guard l(lock);
+ return _write_head_needed();
+ }
+
+
void trim();
void trim_tail() {
lock_guard l(lock);