1
0
mirror of https://github.com/systemd/systemd.git synced 2025-08-15 01:49:58 +03:00

journal: Use 16kb buffer during hole punching

Let's use the same buffer size as used in as copy.h.
This commit is contained in:
Daan De Meyer
2021-12-15 18:22:17 +01:00
parent cdbba44878
commit d951ac5578

View 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;