chiark / gitweb /
journald: fix calculation of disk space
[elogind.git] / src / journal / journal-file.c
index 7f5d7c27b21d22823f4d4fa937cfb4cd20365cb1..41430f310d88d5b96438023947fbf0abf45063ef 100644 (file)
@@ -1740,6 +1740,11 @@ int journal_file_open(
         f->writable = (flags & O_ACCMODE) != O_RDONLY;
         f->prot = prot_from_flags(flags);
 
+        if (template) {
+                f->metrics = template->metrics;
+                f->compress = template->compress;
+        }
+
         f->path = strdup(fname);
         if (!f->path) {
                 r = -ENOMEM;
@@ -2063,7 +2068,7 @@ int journal_directory_vacuum(const char *directory, uint64_t max_use, uint64_t m
                 }
 
                 list[n_list].filename = p;
-                list[n_list].usage = (uint64_t) st.st_blksize * (uint64_t) st.st_blocks;
+                list[n_list].usage = 512UL * (uint64_t) st.st_blocks;
                 list[n_list].seqnum = seqnum;
                 list[n_list].realtime = realtime;
                 list[n_list].seqnum_id = seqnum_id;