]> granicus.if.org Git - esp-idf/commit
nvs: do eager cleanup of HashListBlocks
authorIvan Grokhotkov <ivan@espressif.com>
Fri, 22 Feb 2019 09:28:43 +0000 (17:28 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Thu, 28 Feb 2019 13:58:03 +0000 (21:58 +0800)
commit7ee102a9f658898ac07c4b89923aa7ab2d1b949e
tree99f57693c1c1a21da604b36bab1b2ca8335ced2d
parent70a9e72e06ea493c221e8c2bd058374362841fc8
nvs: do eager cleanup of HashListBlocks

Previously when HashList was removing items, HashListBlocks were
removed lazily. This resulted in empty HashListBlocks dangling around
in full pages, even when all items have been erased. These blocks
would only be deleted when NVS was re-initialized
(nvs_flash_deinit/nvs_flash_init).

This change does eager cleanup instead, based on the code from
@negativekelvin offered in
https://github.com/espressif/esp-idf/issues/1642#issuecomment-367227994.

Closes https://github.com/espressif/esp-idf/issues/1642.
components/nvs_flash/src/nvs_item_hash_list.cpp
components/nvs_flash/test_nvs_host/test_nvs.cpp