|
@ -161,11 +161,17 @@ static s32_t spiffs_delete_obj_lazy(spiffs *fs, spiffs_obj_id obj_id) { |
|
|
return SPIFFS_OK; |
|
|
return SPIFFS_OK; |
|
|
} |
|
|
} |
|
|
SPIFFS_CHECK_RES(res); |
|
|
SPIFFS_CHECK_RES(res); |
|
|
u8_t flags = 0xff & ~SPIFFS_PH_FLAG_IXDELE; |
|
|
u8_t flags = 0xff; |
|
|
|
|
|
#if SPIFFS_NO_BLIND_WRITES |
|
|
|
|
|
res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_READ, |
|
|
|
|
|
0, SPIFFS_PAGE_TO_PADDR(fs, objix_hdr_pix) + offsetof(spiffs_page_header, flags), |
|
|
|
|
|
sizeof(flags), &flags); |
|
|
|
|
|
SPIFFS_CHECK_RES(res); |
|
|
|
|
|
#endif |
|
|
|
|
|
flags &= ~SPIFFS_PH_FLAG_IXDELE; |
|
|
res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_UPDT, |
|
|
res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_UPDT, |
|
|
0, SPIFFS_PAGE_TO_PADDR(fs, objix_hdr_pix) + offsetof(spiffs_page_header, flags), |
|
|
0, SPIFFS_PAGE_TO_PADDR(fs, objix_hdr_pix) + offsetof(spiffs_page_header, flags), |
|
|
sizeof(u8_t), |
|
|
sizeof(flags), &flags); |
|
|
(u8_t *)&flags); |
|
|
|
|
|
return res; |
|
|
return res; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -423,10 +429,17 @@ static s32_t spiffs_lookup_check_validate(spiffs *fs, spiffs_obj_id lu_obj_id, s |
|
|
// just finalize
|
|
|
// just finalize
|
|
|
SPIFFS_CHECK_DBG("LU: FIXUP: unfinalized page is referred, finalizing\n"); |
|
|
SPIFFS_CHECK_DBG("LU: FIXUP: unfinalized page is referred, finalizing\n"); |
|
|
CHECK_CB(fs, SPIFFS_CHECK_LOOKUP, SPIFFS_CHECK_FIX_LOOKUP, p_hdr->obj_id, p_hdr->span_ix); |
|
|
CHECK_CB(fs, SPIFFS_CHECK_LOOKUP, SPIFFS_CHECK_FIX_LOOKUP, p_hdr->obj_id, p_hdr->span_ix); |
|
|
u8_t flags = 0xff & ~SPIFFS_PH_FLAG_FINAL; |
|
|
u8_t flags = 0xff; |
|
|
|
|
|
#if SPIFFS_NO_BLIND_WRITES |
|
|
|
|
|
res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_DA | SPIFFS_OP_C_READ, |
|
|
|
|
|
0, SPIFFS_PAGE_TO_PADDR(fs, cur_pix) + offsetof(spiffs_page_header, flags), |
|
|
|
|
|
sizeof(flags), &flags); |
|
|
|
|
|
SPIFFS_CHECK_RES(res); |
|
|
|
|
|
#endif |
|
|
|
|
|
flags &= ~SPIFFS_PH_FLAG_FINAL; |
|
|
res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_DA | SPIFFS_OP_C_UPDT, |
|
|
res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_DA | SPIFFS_OP_C_UPDT, |
|
|
0, SPIFFS_PAGE_TO_PADDR(fs, cur_pix) + offsetof(spiffs_page_header, flags), |
|
|
0, SPIFFS_PAGE_TO_PADDR(fs, cur_pix) + offsetof(spiffs_page_header, flags), |
|
|
sizeof(u8_t), (u8_t*)&flags); |
|
|
sizeof(flags), &flags); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|