summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-11-22 16:11:20 +0100
committerLennart Poettering <lennart@poettering.net>2020-01-31 15:00:57 +0100
commitb42b9479a8e25cb22de06046f3f809cdb8694442 (patch)
tree68668af83adb548f04834f5ab5987164fa7b05c1 /src
parentjournald: use structured initialization (diff)
downloadsystemd-b42b9479a8e25cb22de06046f3f809cdb8694442.tar.xz
systemd-b42b9479a8e25cb22de06046f3f809cdb8694442.zip
journald: hide current storage determination in helper call
Diffstat (limited to 'src')
-rw-r--r--src/journal/journald-server.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index ad0d2f7349..1440d82102 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -163,13 +163,19 @@ static void patch_min_use(JournalStorage *storage) {
storage->metrics.min_use = MAX(storage->metrics.min_use, storage->space.vfs_used);
}
+static JournalStorage* server_current_storage(Server *s) {
+ assert(s);
+
+ return s->system_journal ? &s->system_storage : &s->runtime_storage;
+}
+
static int determine_space(Server *s, uint64_t *available, uint64_t *limit) {
JournalStorage *js;
int r;
assert(s);
- js = s->system_journal ? &s->system_storage : &s->runtime_storage;
+ js = server_current_storage(s);
r = cache_space_refresh(s, js);
if (r >= 0) {
@@ -189,7 +195,7 @@ void server_space_usage_message(Server *s, JournalStorage *storage) {
assert(s);
if (!storage)
- storage = s->system_journal ? &s->system_storage : &s->runtime_storage;
+ storage = server_current_storage(s);
if (cache_space_refresh(s, storage) < 0)
return;