mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
sdlog2: slow down the free space check a bit more
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user