summaryrefslogtreecommitdiff
path: root/src/journal-remote/journal-remote-write.h
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2021-11-30 16:18:56 +0100
committerDaan De Meyer <daan.j.demeyer@gmail.com>2021-12-06 22:17:38 +0100
commit035b0f8fe8c1883b17d864f15f99846ab206099d (patch)
treeb163a7dec28beb6a6c468f08d71b5bbe05faceff /src/journal-remote/journal-remote-write.h
parentef6bb4dd3e3bb9c210c310026b4d827a46acc762 (diff)
downloadsystemd-035b0f8fe8c1883b17d864f15f99846ab206099d.tar.gz
journal: Introduce journald-file.c for journal file write related logic
Currently, all the logic related to writing journal files lives in journal-file.c which is part of libsystemd (sd-journal). Because it's part of libsystemd, we can't depend on any code from src/shared. To allow using code from src/shared when writing journal files, let's gradually move the write related logic from journal-file.c to journald-file.c in src/journal. This directory is not part of libsystemd and as such can use code from src/shared. We can safely remove any journal write related logic from libsystemd as it's not used by any public APIs in libsystemd. This commit introduces the new file along with the JournaldFile struct which wraps an instance of JournalFile. The goal is to gradually move more functions from journal-file.c and fields from JournalFile to journald-file.c and JournaldFile respectively. This commit also modifies all call sites that write journal files to use JournaldFile instead of JournalFile. All sd-journal tests that write journal files are moved to src/journal so they can make use of journald-file.c. Because the deferred closes logic is only used by journald, we move it out of journal-file.c as well. In journal_file_open(), we would wait for any remaining deferred closes for the file we're about to open to complete before continuing if the file was not newly created. In journald_file_open(), we call this logic unconditionally since it stands that if a file is newly created, it can't have any outstanding deferred closes. No changes in behavior are introduced aside from the earlier execution of waiting for any deferred closes to complete when opening a new journal file.
Diffstat (limited to 'src/journal-remote/journal-remote-write.h')
-rw-r--r--src/journal-remote/journal-remote-write.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/journal-remote/journal-remote-write.h b/src/journal-remote/journal-remote-write.h
index 123015b844..d97f6c674b 100644
--- a/src/journal-remote/journal-remote-write.h
+++ b/src/journal-remote/journal-remote-write.h
@@ -1,13 +1,13 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "journal-file.h"
+#include "journald-file.h"
#include "journal-importer.h"
typedef struct RemoteServer RemoteServer;
typedef struct Writer {
- JournalFile *journal;
+ JournaldFile *journal;
JournalMetrics metrics;
MMapCache *mmap;