summaryrefslogtreecommitdiff
path: root/src/journal/journald-server.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/journal/journald-server.h')
-rw-r--r--src/journal/journald-server.h37
1 files changed, 27 insertions, 10 deletions
diff --git a/src/journal/journald-server.h b/src/journal/journald-server.h
index e025a4cf90..99d91496be 100644
--- a/src/journal/journald-server.h
+++ b/src/journal/journald-server.h
@@ -43,12 +43,30 @@ typedef enum Storage {
typedef enum SplitMode {
SPLIT_UID,
- SPLIT_LOGIN,
+ SPLIT_LOGIN, /* deprecated */
SPLIT_NONE,
_SPLIT_MAX,
_SPLIT_INVALID = -1
} SplitMode;
+typedef struct JournalStorageSpace {
+ usec_t timestamp;
+
+ uint64_t available;
+ uint64_t limit;
+
+ uint64_t vfs_used; /* space used by journal files */
+ uint64_t vfs_available;
+} JournalStorageSpace;
+
+typedef struct JournalStorage {
+ const char *name;
+ const char *path;
+
+ JournalMetrics metrics;
+ JournalStorageSpace space;
+} JournalStorage;
+
struct Server {
int syslog_fd;
int native_fd;
@@ -89,8 +107,8 @@ struct Server {
usec_t rate_limit_interval;
unsigned rate_limit_burst;
- JournalMetrics runtime_metrics;
- JournalMetrics system_metrics;
+ JournalStorage runtime_storage;
+ JournalStorage system_storage;
bool compress;
bool seal;
@@ -103,10 +121,6 @@ struct Server {
unsigned n_forward_syslog_missed;
usec_t last_warn_forward_syslog_missed;
- uint64_t cached_space_available;
- uint64_t cached_space_limit;
- usec_t cached_space_timestamp;
-
uint64_t var_available_timestamp;
usec_t max_retention_usec;
@@ -149,14 +163,16 @@ struct Server {
char *cgroup_root;
usec_t watchdog_usec;
+
+ usec_t last_realtime_clock;
};
#define SERVER_MACHINE_ID(s) ((s)->machine_id_field + strlen("_MACHINE_ID="))
-#define N_IOVEC_META_FIELDS 20
+#define N_IOVEC_META_FIELDS 22
#define N_IOVEC_KERNEL_FIELDS 64
#define N_IOVEC_UDEV_FIELDS 32
-#define N_IOVEC_OBJECT_FIELDS 12
+#define N_IOVEC_OBJECT_FIELDS 14
#define N_IOVEC_PAYLOAD_FIELDS 15
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);
@@ -178,9 +194,10 @@ SplitMode split_mode_from_string(const char *s) _pure_;
int server_init(Server *s);
void server_done(Server *s);
void server_sync(Server *s);
-int server_vacuum(Server *s, bool verbose, bool patch_min_use);
+int server_vacuum(Server *s, bool verbose);
void server_rotate(Server *s);
int server_schedule_sync(Server *s, int priority);
int server_flush_to_var(Server *s);
void server_maybe_append_tags(Server *s);
int server_process_datagram(sd_event_source *es, int fd, uint32_t revents, void *userdata);
+void server_space_usage_message(Server *s, JournalStorage *storage);