journal: Move offlining logic to journald-file.c
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 30 Nov 2021 15:39:35 +0000 (16:39 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 6 Dec 2021 21:17:40 +0000 (22:17 +0100)
commit764721cc07d76641e9e674416aa3c704f481a954
tree627bc19684edf66f1708cd04575eb1d54f15ffc5
parent035b0f8fe8c1883b17d864f15f99846ab206099d
journal: Move offlining logic to journald-file.c

With this change, the logic to write the final tag, emit the final
change notification and to offline the file moves from journal_file_close()
to journald_file_close(). Since all this logic is only executed when
the journal file is writable and all code that writes journal files
already uses journald_file_close() instead of journal_file_close(), this
change should not introduce any changes in behaviour.

Moving the offline related logic to journald-file.c allows us to use
code from src/shared in the offlining logic, more specifically, we can
use the file copying logic from copy.h to fix BTRFS filesystem compression
for journal files when archiving.
src/journal/journald-file.c
src/journal/journald-file.h
src/journal/journald-server.c
src/journal/meson.build
src/libsystemd/sd-journal/journal-file.c
src/libsystemd/sd-journal/journal-file.h