diff options
author | Ban Siesta <bansiesta@gmail.com> | 2015-01-04 14:06:33 +0000 |
---|---|---|
committer | Ban Siesta <bansiesta@gmail.com> | 2015-01-04 14:06:33 +0000 |
commit | 04c273bca6c99f31fd04741234d9c8efa849b553 (patch) | |
tree | fd936bb2c7c2db5506d058ad4e657de63ad548d4 /src/modules/sdlog2/sdlog2.c | |
parent | 3b418a5a595f0e48c4365217815372d9b278f64c (diff) | |
download | px4-firmware-04c273bca6c99f31fd04741234d9c8efa849b553.tar.gz px4-firmware-04c273bca6c99f31fd04741234d9c8efa849b553.tar.bz2 px4-firmware-04c273bca6c99f31fd04741234d9c8efa849b553.zip |
sdlog2: slow down the free space check a bit more
Diffstat (limited to 'src/modules/sdlog2/sdlog2.c')
-rw-r--r-- | src/modules/sdlog2/sdlog2.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/modules/sdlog2/sdlog2.c b/src/modules/sdlog2/sdlog2.c index 3b3b5c7a5..8537d03b3 100644 --- a/src/modules/sdlog2/sdlog2.c +++ b/src/modules/sdlog2/sdlog2.c @@ -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); |