summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFranck Bui <fbui@suse.com>2016-10-12 09:05:55 +0200
committerFranck Bui <fbui@suse.com>2016-10-19 09:53:07 +0200
commita0edc477bd80208596badb9bc147a0d0eb06fbf6 (patch)
tree854a36ccf9895fae09bf6a856c1b19191a25f2d7 /src
parent23aba343498f3cbe0bdce6c841a0c34339d1be90 (diff)
journal: introduce cache_space_invalidate()
Introduce a dedicated helper in order to reset the storage space cache.
Diffstat (limited to 'src')
-rw-r--r--src/journal/journald-server.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 5f77bd296d..4839c58918 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -125,6 +125,10 @@ static int determine_path_usage(Server *s, const char *path, uint64_t *ret_used,
return 0;
}
+static void cache_space_invalidate(JournalStorageSpace *space) {
+ memset(space, 0, sizeof(*space));
+}
+
static int determine_space_for(
Server *s,
JournalStorage *storage,
@@ -541,11 +545,7 @@ static void do_vacuum(
if (r < 0 && r != -ENOENT)
log_warning_errno(r, "Failed to vacuum %s, ignoring: %m", storage->path);
- storage->space.limit = 0;
- storage->space.available = 0;
- storage->space.timestamp = 0;
- storage->space.vfs_used = 0;
- storage->space.vfs_available = 0;
+ cache_space_invalidate(&storage->space);
}
int server_vacuum(Server *s, bool verbose, bool patch_min_use) {