From 0b5ac0039b5c6dfb834ca8a5b958dd1a79a6bb5a Mon Sep 17 00:00:00 2001 From: Tobias Wiens Date: Sun, 24 Apr 2022 23:18:12 +0200 Subject: [PATCH] adding ifdef guards to update method. should only be called if cache is used. --- src/fdb_kvdb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fdb_kvdb.c b/src/fdb_kvdb.c index 4faa63c..f479eea 100644 --- a/src/fdb_kvdb.c +++ b/src/fdb_kvdb.c @@ -1482,8 +1482,10 @@ static bool check_and_recovery_kv_cb(fdb_kv_t kv, void *arg1, void *arg2) _fdb_write_status((fdb_db_t)db, kv->addr.start, status_table, FDB_KV_STATUS_NUM, FDB_KV_ERR_HDR, true); return true; } else if (kv->crc_is_ok && kv->status == FDB_KV_WRITE) { - /* update the cache when first load */ +#ifdef FDB_KV_USING_CACHE + /* update the cache when first load. If caching is disabled, this step is not performed */ update_kv_cache(db, kv->name, kv->name_len, kv->addr.start); +#endif } return false;