chiark / gitweb /
journald: remove a number of malloc()s from the syslog message handling
[elogind.git] / src / journal / journald-server.h
index 86c4be4ba260a960d281e42d6f40315e7a6f3e23..65a2b71a7f15bdc679336a2683cb840a4acbff47 100644 (file)
@@ -45,8 +45,8 @@ typedef enum Storage {
 } Storage;
 
 typedef enum SplitMode {
-        SPLIT_LOGIN,
         SPLIT_UID,
+        SPLIT_LOGIN,
         SPLIT_NONE,
         _SPLIT_MAX,
         _SPLIT_INVALID = -1
@@ -76,7 +76,7 @@ typedef struct Server {
 
         JournalFile *runtime_journal;
         JournalFile *system_journal;
-        Hashmap *user_journals;
+        OrderedHashmap *user_journals;
 
         uint64_t seqnum;
 
@@ -97,6 +97,7 @@ typedef struct Server {
         bool forward_to_kmsg;
         bool forward_to_syslog;
         bool forward_to_console;
+        bool forward_to_wall;
 
         unsigned n_forward_syslog_missed;
         usec_t last_warn_forward_syslog_missed;
@@ -119,6 +120,7 @@ typedef struct Server {
         int max_level_syslog;
         int max_level_kmsg;
         int max_level_console;
+        int max_level_wall;
 
         Storage storage;
         SplitMode split_mode;
@@ -136,6 +138,9 @@ typedef struct Server {
         char machine_id_field[sizeof("_MACHINE_ID=") + 32];
         char boot_id_field[sizeof("_BOOT_ID=") + 32];
         char *hostname_field;
+
+        /* Cached cgroup root, so that we don't have to query that all the time */
+        char *cgroup_root;
 } Server;
 
 #define N_IOVEC_META_FIELDS 20
@@ -143,7 +148,7 @@ typedef struct Server {
 #define N_IOVEC_UDEV_FIELDS 32
 #define N_IOVEC_OBJECT_FIELDS 11
 
-void server_dispatch_message(Server *s, struct iovec *iovec, unsigned n, unsigned m, struct ucred *ucred, struct timeval *tv, const char *label, size_t label_len, const char *unit_id, int priority, pid_t object_pid);
+void server_dispatch_message(Server *s, struct iovec *iovec, unsigned n, unsigned m, const struct ucred *ucred, const struct timeval *tv, const char *label, size_t label_len, const char *unit_id, int priority, pid_t object_pid);
 void server_driver_message(Server *s, sd_id128_t message_id, const char *format, ...) _printf_(3,4);
 
 /* gperf lookup function */