Skip to content
Snippets Groups Projects
Commit 843eecfc authored by Austin Clements's avatar Austin Clements
Browse files

Only commit log to disk if something was written in to it.

Without this, every write to the console results in log writes.
parent 7f1718ca
No related branches found
No related tags found
No related merge requests found
......@@ -143,11 +143,13 @@ begin_trans(void)
void
commit_trans(void)
{
write_head(); // This causes all blocks till log.head to be commited
install_trans(); // Install all the transactions till head
log.lh.n = 0;
write_head(); // Reclaim log
if (log.lh.n > 0) {
write_head(); // This causes all blocks till log.head to be commited
install_trans(); // Install all the transactions till head
log.lh.n = 0;
write_head(); // Reclaim log
}
acquire(&log.lock);
log.intrans = 0;
wakeup(&log);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment