]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/journal/journald-server.h
journald: hook up journald with the memory pressure and SIGRTMIN+18 logic
[thirdparty/systemd.git] / src / journal / journald-server.h
index ee8f37419088c2e7e9c99e29ba078ec28b4923d5..e03cfc04c9407c67ba689523220d1fa6cd05d829 100644 (file)
@@ -8,6 +8,7 @@
 
 typedef struct Server Server;
 
+#include "common-signal.h"
 #include "conf-parser.h"
 #include "hashmap.h"
 #include "journald-context.h"
@@ -60,6 +61,13 @@ typedef struct JournalStorage {
         JournalStorageSpace space;
 } JournalStorage;
 
+/* This structure will be kept in $RUNTIME_DIRECTORY/seqnum and is mapped by journald, and is used to
+ * maintain the sequence number counter with its seqnum ID */
+typedef struct SeqnumData {
+        sd_id128_t id;
+        uint64_t seqnum;
+} SeqnumData;
+
 struct Server {
         char *namespace;
 
@@ -88,12 +96,13 @@ struct Server {
         sd_event_source *notify_event_source;
         sd_event_source *watchdog_event_source;
         sd_event_source *idle_event_source;
+        struct sigrtmin18_info sigrtmin18_info;
 
         ManagedJournalFile *runtime_journal;
         ManagedJournalFile *system_journal;
         OrderedHashmap *user_journals;
 
-        uint64_t seqnum;
+        SeqnumData *seqnum;
 
         char *buffer;
 
@@ -227,3 +236,6 @@ void server_space_usage_message(Server *s, JournalStorage *storage);
 
 int server_start_or_stop_idle_timer(Server *s);
 int server_refresh_idle_timer(Server *s);
+
+int server_map_seqnum_file(Server *s, const char *fname, size_t size, void **ret);
+void server_unmap_seqnum_file(void *p, size_t size);