#include "util.h"
#include "sd-id128.h"
-#define DEFAULT_MAX_SIZE (1024ULL*128ULL)
+#define DEFAULT_MAX_SIZE (128ULL*1024ULL*1024ULL)
#define DEFAULT_MIN_SIZE (256ULL*1024ULL)
#define DEFAULT_KEEP_FREE (1ULL*1024ULL*1024ULL)
#define DEFAULT_MAX_USE (16ULL*1024ULL*1024ULL*16ULL)
uint64_t max_size;
uint64_t min_size;
uint64_t keep_free;
+ uint64_t max_use;
} JournalMetrics;
typedef struct JournalFile {
JournalRateLimit *rate_limit;
JournalMetrics metrics;
- uint64_t max_use;
bool compress;
uint64_t cached_available_space;
sum += (uint64_t) st.st_blocks * (uint64_t) st.st_blksize;
}
- avail = sum >= s->max_use ? 0 : s->max_use - sum;
+ avail = sum >= s->metrics.max_use ? 0 : s->metrics.max_use - sum;
ss_avail = ss.f_bsize * ss.f_bavail;
return;
}
- r = journal_directory_vacuum(p, s->max_use, s->metrics.keep_free);
+ r = journal_directory_vacuum(p, s->metrics.max_use, s->metrics.keep_free);
if (r < 0 && r != -ENOENT)
log_error("Failed to vacuum %s: %s", p, strerror(-r));
free(p);
return;
}
- r = journal_directory_vacuum(p, s->max_use, s->metrics.keep_free);
+ r = journal_directory_vacuum(p, s->metrics.max_use, s->metrics.keep_free);
if (r < 0 && r != -ENOENT)
log_error("Failed to vacuum %s: %s", p, strerror(-r));
free(p);
s->metrics.max_size = DEFAULT_MAX_SIZE;
s->metrics.min_size = DEFAULT_MIN_SIZE;
s->metrics.keep_free = DEFAULT_KEEP_FREE;
- s->max_use = DEFAULT_MAX_USE;
+ s->metrics.max_use = DEFAULT_MAX_USE;
s->compress = true;
s->user_journals = hashmap_new(trivial_hash_func, trivial_compare_func);