Lines Matching refs:empty_ate
21 static int zms_get_sector_header(struct zms_fs *fs, uint64_t addr, struct zms_ate *empty_ate,
488 static int zms_validate_closed_sector(struct zms_fs *fs, uint64_t addr, struct zms_ate *empty_ate, in zms_validate_closed_sector() argument
494 rc = zms_get_sector_header(fs, addr, empty_ate, close_ate); in zms_validate_closed_sector()
499 if (zms_empty_ate_valid(fs, empty_ate) && zms_close_ate_valid(fs, close_ate) && in zms_validate_closed_sector()
500 (empty_ate->cycle_cnt == close_ate->cycle_cnt)) { in zms_validate_closed_sector()
594 struct zms_ate empty_ate; in zms_compute_prev_addr() local
610 sec_closed = zms_validate_closed_sector(fs, *addr, &empty_ate, &close_ate); in zms_compute_prev_addr()
727 struct zms_ate empty_ate; in zms_add_empty_ate() local
735 empty_ate.id = ZMS_HEAD_ID; in zms_add_empty_ate()
736 empty_ate.len = 0xffff; in zms_add_empty_ate()
737 empty_ate.offset = 0U; in zms_add_empty_ate()
738 empty_ate.metadata = in zms_add_empty_ate()
751 empty_ate.cycle_cnt = (cycle_cnt + 1) % BIT(8); in zms_add_empty_ate()
752 zms_ate_crc8_update(&empty_ate); in zms_add_empty_ate()
759 rc = zms_flash_ate_wrt(fs, &empty_ate); in zms_add_empty_ate()
771 struct zms_ate empty_ate; in zms_get_sector_cycle() local
777 rc = zms_flash_ate_rd(fs, empty_addr, &empty_ate); in zms_get_sector_cycle()
783 if (zms_empty_ate_valid(fs, &empty_ate)) { in zms_get_sector_cycle()
784 *cycle_cnt = empty_ate.cycle_cnt; in zms_get_sector_cycle()
792 static int zms_get_sector_header(struct zms_fs *fs, uint64_t addr, struct zms_ate *empty_ate, in zms_get_sector_header() argument
806 rc = zms_flash_ate_rd(fs, close_addr + fs->ate_size, empty_ate); in zms_get_sector_header()
881 struct zms_ate empty_ate; in zms_gc() local
921 sec_closed = zms_validate_closed_sector(fs, gc_addr, &empty_ate, &close_ate); in zms_gc()
932 fs->sector_cycle = empty_ate.cycle_cnt; in zms_gc()
1070 struct zms_ate empty_ate; in zms_init() local
1087 sec_closed = zms_validate_closed_sector(fs, addr, &empty_ate, &close_ate); in zms_init()
1093 fs->sector_cycle = empty_ate.cycle_cnt; in zms_init()
1099 if (ZMS_GET_MAGIC_NUMBER(empty_ate.metadata) == ZMS_MAGIC_NUMBER) { in zms_init()
1102 if (ZMS_GET_VERSION(empty_ate.metadata) != ZMS_DEFAULT_VERSION) { in zms_init()
1112 sec_closed = zms_validate_closed_sector(fs, addr, &empty_ate, &close_ate); in zms_init()
1118 fs->sector_cycle = empty_ate.cycle_cnt; in zms_init()
1148 rc = zms_get_sector_header(fs, addr, &empty_ate, &close_ate); in zms_init()
1153 if (zms_empty_ate_valid(fs, &empty_ate)) { in zms_init()
1155 if (ZMS_GET_MAGIC_NUMBER(empty_ate.metadata) == ZMS_MAGIC_NUMBER) { in zms_init()
1158 if (ZMS_GET_VERSION(empty_ate.metadata) != ZMS_DEFAULT_VERSION) { in zms_init()
1239 sec_closed = zms_validate_closed_sector(fs, addr, &empty_ate, &close_ate); in zms_init()
1252 fs->sector_cycle = empty_ate.cycle_cnt; in zms_init()
1665 struct zms_ate empty_ate; in zms_calc_free_space() local
1743 sec_closed = zms_validate_closed_sector(fs, step_addr, &empty_ate, &close_ate); in zms_calc_free_space()
1756 fs->sector_cycle = empty_ate.cycle_cnt; in zms_calc_free_space()