sdlog2: slow down the free space check a bit more

This commit is contained in:
Ban Siesta
2015-01-04 14:06:33 +00:00
parent 3b418a5a59
commit 04c273bca6

View File

@@ -594,16 +594,19 @@ static void *logwriter_thread(void *arg)
should_wait = true;
}
if (++poll_count == 10) {
/* slow down fsync */
if (poll_count % 10 == 0) {
fsync(log_fd);
poll_count = 0;
/* slow down the check even more, and don't do both at the same time */
} else if (poll_count % 1000 == 5) {
/* check if space is available, if not stop everything */
if (check_free_space() != OK) {
logwriter_should_exit = true;
main_thread_should_exit = true;
}
}
poll_count++;
}
fsync(log_fd);