Lines Matching refs:ate_wra

47 	addr = fs->ate_wra;  in nvs_lookup_cache_rebuild()
65 if (addr == fs->ate_wra) { in nvs_lookup_cache_rebuild()
164 rc = nvs_flash_al_wrt(fs, fs->ate_wra, entry, in nvs_flash_ate_wrt()
169 fs->lookup_cache[nvs_lookup_cache_pos(entry->id)] = fs->ate_wra; in nvs_flash_ate_wrt()
172 fs->ate_wra -= nvs_al_size(fs, sizeof(struct nvs_ate)); in nvs_flash_ate_wrt()
503 *addr = fs->ate_wra; in nvs_prev_ate()
545 close_ate.offset = (uint16_t)((fs->ate_wra + ate_size) & ADDR_OFFS_MASK); in nvs_sector_close()
548 fs->ate_wra &= ADDR_SECT_MASK; in nvs_sector_close()
549 fs->ate_wra += (fs->sector_size - ate_size); in nvs_sector_close()
555 nvs_sector_advance(fs, &fs->ate_wra); in nvs_sector_close()
557 fs->data_wra = fs->ate_wra & ADDR_SECT_MASK; in nvs_sector_close()
566 LOG_DBG("Adding gc done ate at %x", fs->ate_wra & ADDR_OFFS_MASK); in nvs_add_gc_done_ate()
590 sec_addr = (fs->ate_wra & ADDR_SECT_MASK); in nvs_gc()
633 wlk_addr = fs->ate_wra; in nvs_gc()
636 wlk_addr = fs->ate_wra; in nvs_gc()
653 } while (wlk_addr != fs->ate_wra); in nvs_gc()
688 if (fs->ate_wra >= (fs->data_wra + ate_size)) { in nvs_gc()
772 fs->ate_wra = addr; in nvs_startup()
775 while (fs->ate_wra >= fs->data_wra) { in nvs_startup()
776 rc = nvs_flash_ate_rd(fs, fs->ate_wra, &last_ate); in nvs_startup()
802 if (fs->ate_wra == fs->data_wra && last_ate.len) { in nvs_startup()
809 fs->ate_wra -= ate_size; in nvs_startup()
818 addr = fs->ate_wra & ADDR_SECT_MASK; in nvs_startup()
831 addr = fs->ate_wra + ate_size; in nvs_startup()
849 addr = fs->ate_wra & ADDR_SECT_MASK; in nvs_startup()
855 rc = nvs_flash_erase_sector(fs, fs->ate_wra); in nvs_startup()
859 fs->ate_wra &= ADDR_SECT_MASK; in nvs_startup()
860 fs->ate_wra += (fs->sector_size - 2 * ate_size); in nvs_startup()
861 fs->data_wra = (fs->ate_wra & ADDR_SECT_MASK); in nvs_startup()
869 fs->lookup_cache[i] = fs->ate_wra; in nvs_startup()
877 while (fs->ate_wra > fs->data_wra) { in nvs_startup()
878 empty_len = fs->ate_wra - fs->data_wra; in nvs_startup()
896 if (((fs->ate_wra + 2 * ate_size) == fs->sector_size) && in nvs_startup()
897 (fs->data_wra != (fs->ate_wra & ADDR_SECT_MASK))) { in nvs_startup()
898 rc = nvs_flash_erase_sector(fs, fs->ate_wra); in nvs_startup()
902 fs->data_wra = fs->ate_wra & ADDR_SECT_MASK; in nvs_startup()
915 if ((!rc) && ((fs->ate_wra & ADDR_OFFS_MASK) == in nvs_startup()
998 (fs->ate_wra >> ADDR_SECT_SHIFT), in nvs_mount()
999 (fs->ate_wra & ADDR_OFFS_MASK)); in nvs_mount()
1041 wlk_addr = fs->ate_wra; in nvs_write()
1055 if (wlk_addr == fs->ate_wra) { in nvs_write()
1110 if (fs->ate_wra >= (fs->data_wra + required_space)) { in nvs_write()
1172 wlk_addr = fs->ate_wra; in nvs_read_hist()
1185 if (wlk_addr == fs->ate_wra) { in nvs_read_hist()
1190 if (((wlk_addr == fs->ate_wra) && (wlk_ate.id != id)) || in nvs_read_hist()
1236 step_addr = fs->ate_wra; in nvs_calc_free_space()
1244 wlk_addr = fs->ate_wra; in nvs_calc_free_space()
1252 (wlk_addr == fs->ate_wra)) { in nvs_calc_free_space()
1264 if (step_addr == fs->ate_wra) { in nvs_calc_free_space()