journal-file: require MMapCache* for journal_file_open()
authorVito Caputo <vcaputo@pengaru.com>
Tue, 7 Dec 2021 22:18:14 +0000 (14:18 -0800)
committerVito Caputo <vcaputo@pengaru.com>
Tue, 7 Dec 2021 22:39:20 +0000 (14:39 -0800)
commit74fb5be62d163ce234cc37fd0166bc587cc23e07
treeb385bcc10d9f84d0348cec22fdfe2b330253cbc2
parent333d0672625b0b466f9d1d7b46e452105ec13a2b
journal-file: require MMapCache* for journal_file_open()

Previously the MMapCache* was optionally NULL, which open would
handle by creating a new MMapCache* for the occasion.

This produced some slightly circuitous refcount-handling code in
the function, as well as arguably creating opportunities for
weirdness where an MMapCache* was intended to be supplied but
happened to be NULL, which this magic would then paper over.

In any case, this was basically only being utilized by tests,
apparently just to avoid having to create an MMapCache.  So
update the relevant tests to supply an MMapCache and make
journal_file_open() treat a NULL MMapCache* as fatal w/assert.
src/journal/test-journal-flush.c
src/journal/test-journal-interleaving.c
src/journal/test-journal-stream.c
src/journal/test-journal-verify.c
src/journal/test-journal.c
src/libsystemd/sd-journal/journal-file.c