if (alloc.size()) {
log_t.op_alloc_add(id, offset, length);
- int r = _flush_log();
+ int r = _flush_and_sync_log();
assert(r == 0);
alloc[id]->init_add_free(offset, length);
}
block_all[id].erase(*offset, *length);
block_total[id] -= *length;
log_t.op_alloc_rm(id, *offset, *length);
- r = _flush_log();
+ r = _flush_and_sync_log();
assert(r == 0);
if (logger)
log_t.op_alloc_add(bdev, q.get_start(), q.get_len());
}
}
- _flush_log();
+ _flush_and_sync_log();
// write supers
super.log_fnode = log_file->fnode;
}
}
-int BlueFS::_flush_log()
+int BlueFS::_flush_and_sync_log()
{
log_t.seq = ++log_seq;
log_t.uuid = super.uuid;
if (h->file->dirty) {
dout(20) << __func__ << " file metadata is dirty, flushing log on "
<< h->file->fnode << dendl;
- _flush_log();
+ _flush_and_sync_log();
assert(!h->file->dirty);
}
}
p->commit_start();
}
}
- _flush_log();
+ _flush_and_sync_log();
for (auto p : alloc) {
if (p) {
p->commit_finish();
void _flush_wait(FileWriter *h);
void _fsync(FileWriter *h);
- int _flush_log();
+ int _flush_and_sync_log();
uint64_t _estimate_log_size();
void _maybe_compact_log();
void _compact_log();