]> git.ipfire.org Git - thirdparty/systemd.git/commit
journal: truncate archived journals
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 16 Nov 2021 23:45:58 +0000 (23:45 +0000)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 6 Dec 2021 13:54:06 +0000 (14:54 +0100)
commitab6e257b3e4e5b95f3750ed019bed6e89989e41b
tree5b992cd04743fa3422ed61dcfab3480e49b10c18
parent117e21121e857b4b7d81949542e8dd257265970a
journal: truncate archived journals

Journal files have space allocated in 8MiB-aligned increments. This
can add up to substantial wasted space as many archived journals
accumulate without using all the allocated space. Let's truncate
journal files to their actually used size when archiving them to
reclaim this unused space.

As the mmap cache is not thread-safe, we can't call
journal_file_move_to_object() from the offline thread. Instead,
we use journal_file_read_object() which doesn't rely on the mmap
cache.
src/libsystemd/sd-journal/journal-file.c