From d951ac5578cafe3d4c0a18e5546b90caf8b01f66 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Wed, 15 Dec 2021 18:22:17 +0100 Subject: [PATCH] journal: Use 16kb buffer during hole punching Let's use the same buffer size as used in as copy.h. --- src/journal/journald-file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/journal/journald-file.c b/src/journal/journald-file.c index bf0933189cc..64f522a7aa8 100644 --- a/src/journal/journald-file.c +++ b/src/journal/journald-file.c @@ -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; -- 2.47.3