summaryrefslogtreecommitdiff
path: root/src/journal/journald-server.h
diff options
context:
space:
mode:
authorFranck Bui <fbui@suse.com>2016-10-04 17:13:21 +0200
committerFranck Bui <fbui@suse.com>2016-10-19 09:53:07 +0200
commit266a470005c65851bb5cf6ab6fc1bb0828456ae2 (patch)
tree42c482d1e99617d386d40bdb9f0326afed79f1de /src/journal/journald-server.h
parente0ed6db9cdde5ee64fb91f131beb0aa1690bc59a (diff)
journal: introduce JournalStorage and JournalStorageSpace structures
This structure keeps track of specificities for a given journal type (persistent or volatile) such as metrics, name, etc... The cached space values are now moved in this structure so that each journal has its own set of cached values. Previously only one set existed and we didn't know if the cached values were for the runtime journal or the persistent one. When doing: determine_space_for(s, runtime_metrics, ...); determine_space_for(s, system_metrics, ...); the second call returned the cached values for the runtime metrics.
Diffstat (limited to 'src/journal/journald-server.h')
-rw-r--r--src/journal/journald-server.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/journal/journald-server.h b/src/journal/journald-server.h
index cc68a0a690..9cf4fad722 100644
--- a/src/journal/journald-server.h
+++ b/src/journal/journald-server.h
@@ -49,6 +49,20 @@ typedef enum SplitMode {
_SPLIT_INVALID = -1
} SplitMode;
+typedef struct JournalStorageSpace {
+ uint64_t available;
+ uint64_t limit;
+ usec_t timestamp;
+} 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 +103,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 +117,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;