From 11defa5654ad8ea228ca0fcee2eda19b67650cd5 Mon Sep 17 00:00:00 2001 From: rkhapov Date: Fri, 24 Jan 2025 08:09:58 +0000 Subject: [PATCH] sources/storage.h: add storage link into watchdog To use it later Signed-off-by: rkhapov --- sources/config_reader.c | 1 + sources/storage.c | 5 +++-- sources/storage.h | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sources/config_reader.c b/sources/config_reader.c index bd56307b..7292d68f 100644 --- a/sources/config_reader.c +++ b/sources/config_reader.c @@ -950,6 +950,7 @@ static int od_config_reader_storage(od_config_reader_t *reader, extensions) == NOT_OK_RESPONSE) goto error; + storage->watchdog->storage = storage; continue; default: { od_config_reader_error(reader, &token, diff --git a/sources/storage.c b/sources/storage.c index 444f3c9c..2ace9658 100644 --- a/sources/storage.c +++ b/sources/storage.c @@ -434,11 +434,12 @@ void od_storage_watchdog_watch(void *arg) od_instance_t *instance = global->instance; od_debug(&instance->logger, "watchdog", NULL, NULL, - "start lag polling watchdog"); + "start watchdog for storage '%s'", watchdog->storage->name); od_storage_watchdog_do_polling_loop(watchdog); od_debug(&instance->logger, "watchdog", NULL, NULL, - "deallocating storage watchdog"); + "deallocating watchdog for storage '%s'", + watchdog->storage->name); od_storage_watchdog_free(watchdog); } diff --git a/sources/storage.h b/sources/storage.h index 4916489d..1d3acdd3 100644 --- a/sources/storage.h +++ b/sources/storage.h @@ -31,6 +31,8 @@ struct od_storage_watchdog { int online; od_global_t *global; + + od_rule_storage_t *storage; }; od_storage_watchdog_t *od_storage_watchdog_allocate(od_global_t *);