sd-journal: introduce journal_file_pin_object()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 30 Sep 2023 03:03:13 +0000 (12:03 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 4 Nov 2023 02:47:55 +0000 (11:47 +0900)
commita1b8d21fab0708d055aeb63e17f83c2df501c185
tree858a2d1597a5481ed5be8b90bdfe2a5fe864f352
parent7a56f6b2b9ac423ecdf91733bbdd91a13d56ea34
sd-journal: introduce journal_file_pin_object()

Previously, OBJECT_UNUSED was used for 'pinning' the mmap cache for an
object. But, OBJECT_UNUSED is also used for reading object when type
cannot be determined before read, e.g. when reading the tail object.

Let's introduce another category for pinning mmap cache, and use it when
we want to temporary pin an object.
src/libsystemd/sd-journal/journal-file.c
src/libsystemd/sd-journal/journal-file.h
src/libsystemd/sd-journal/mmap-cache.c
src/libsystemd/sd-journal/mmap-cache.h
src/libsystemd/sd-journal/sd-journal.c