#define DEFAULT_WINDOW_SIZE (128ULL*1024ULL*1024ULL)
-#define COMPRESSION_SIZE_THRESHOLD (64ULL)
+#define COMPRESSION_SIZE_THRESHOLD (512ULL)
/* This is the minimum journal file size */
#define JOURNAL_FILE_SIZE_MIN (64ULL*1024ULL)
if (fstat(f->fd, &f->last_stat) < 0)
return -errno;
- f->header->arena_size = new_size - htole64(f->header->arena_offset);
+ f->header->arena_size = htole64(new_size - le64toh(f->header->arena_offset));
return 0;
}
* the window space before and half behind the
* requested mapping */
- delta = PAGE_ALIGN((DEFAULT_WINDOW_SIZE - size) / 2);
+ delta = (DEFAULT_WINDOW_SIZE - size) / 2;
if (delta > offset)
delta = offset;
delta = 0;
if (offset + size > (uint64_t) f->last_stat.st_size)
- size = PAGE_ALIGN((uint64_t) f->last_stat.st_size - offset);
+ size = (uint64_t) f->last_stat.st_size - offset;
if (size <= 0)
return -EADDRNOTAVAIL;
if (r < 0)
return r;
- log_error("=> %s seqnr=%lu n_entries=%lu", f->path, (unsigned long) o->entry.seqnum, (unsigned long) f->header->n_entries);
+ /* log_debug("=> %s seqnr=%lu n_entries=%lu", f->path, (unsigned long) o->entry.seqnum, (unsigned long) f->header->n_entries); */
if (f->header->head_entry_realtime == 0)
f->header->head_entry_realtime = o->entry.realtime;
void journal_default_metrics(JournalMetrics *m, int fd) {
uint64_t fs_size = 0;
struct statvfs ss;
- char a[64], b[64], c[64], d[64];
+ char a[FORMAT_BYTES_MAX], b[FORMAT_BYTES_MAX], c[FORMAT_BYTES_MAX], d[FORMAT_BYTES_MAX];
assert(m);
assert(fd >= 0);