From 22d434b1eee2547ab26882519265143cecc3efd7 Mon Sep 17 00:00:00 2001 From: Leonardo Alminana Date: Thu, 21 Sep 2023 17:55:03 +0200 Subject: [PATCH] config: added chunkio trimming support Signed-off-by: Leonardo Alminana --- include/fluent-bit/flb_config.h | 2 ++ src/flb_config.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/include/fluent-bit/flb_config.h b/include/fluent-bit/flb_config.h index 59bc3a57c8e..a00ac48bf55 100644 --- a/include/fluent-bit/flb_config.h +++ b/include/fluent-bit/flb_config.h @@ -225,6 +225,7 @@ struct flb_config { int storage_del_bad_chunks; /* delete irrecoverable chunks */ char *storage_bl_mem_limit; /* storage backlog memory limit */ struct flb_storage_metrics *storage_metrics_ctx; /* storage metrics context */ + int storage_trim_files; /* enable/disable file trimming */ /* Embedded SQL Database support (SQLite3) */ #ifdef FLB_HAVE_SQLDB @@ -355,6 +356,7 @@ enum conf_type { #define FLB_CONF_STORAGE_MAX_CHUNKS_UP "storage.max_chunks_up" #define FLB_CONF_STORAGE_DELETE_IRRECOVERABLE_CHUNKS \ "storage.delete_irrecoverable_chunks" +#define FLB_CONF_STORAGE_TRIM_FILES "storage.trim_files" /* Coroutines */ #define FLB_CONF_STR_CORO_STACK_SIZE "Coro_Stack_Size" diff --git a/src/flb_config.c b/src/flb_config.c index 5f5289d0186..34a4e727b0e 100644 --- a/src/flb_config.c +++ b/src/flb_config.c @@ -147,6 +147,9 @@ struct flb_service_config service_configs[] = { {FLB_CONF_STORAGE_DELETE_IRRECOVERABLE_CHUNKS, FLB_CONF_TYPE_BOOL, offsetof(struct flb_config, storage_del_bad_chunks)}, + {FLB_CONF_STORAGE_TRIM_FILES, + FLB_CONF_TYPE_BOOL, + offsetof(struct flb_config, storage_trim_files)}, /* Coroutines */ {FLB_CONF_STR_CORO_STACK_SIZE,