1
0
mirror of https://github.com/armink/FlashDB.git synced 2025-01-29 04:32:53 +08:00

Merge pull request #147 from T721/master

adding ifdef guards to update method. should only be called if cache is used
This commit is contained in:
朱天龙 (Armink) 2022-04-25 15:30:01 +08:00 committed by GitHub
commit c175635358
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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); _fdb_write_status((fdb_db_t)db, kv->addr.start, status_table, FDB_KV_STATUS_NUM, FDB_KV_ERR_HDR, true);
return true; return true;
} else if (kv->crc_is_ok && kv->status == FDB_KV_WRITE) { } 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); update_kv_cache(db, kv->name, kv->name_len, kv->addr.start);
#endif
} }
return false; return false;