]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal: Use 16kb buffer during hole punching
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 15 Dec 2021 17:22:17 +0000 (18:22 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 15 Dec 2021 17:22:17 +0000 (18:22 +0100)
Let's use the same buffer size as used in as copy.h.

src/journal/journald-file.c

index bf0933189cc9ce1c157f16a8644eb151632b0579..64f522a7aa86143d60d3eae83b36faea6471eeda 100644 (file)
@@ -15,6 +15,7 @@
 #include "stat-util.h"
 #include "sync-util.h"
 
+#define PAYLOAD_BUFFER_SIZE (16U * 1024U)
 #define MINIMUM_HOLE_SIZE (1U * 1024U * 1024U / 2U)
 
 static int journald_file_truncate(JournalFile *f) {
@@ -78,7 +79,7 @@ static int journald_file_entry_array_punch_hole(JournalFile *f, uint64_t p, uint
 }
 
 static int journald_file_punch_holes(JournalFile *f) {
-        HashItem items[4096 / sizeof(HashItem)];
+        HashItem items[PAYLOAD_BUFFER_SIZE / sizeof(HashItem)];
         uint64_t p, sz;
         size_t to_read;
         ssize_t n;