mirror of
https://github.com/pellepl/spiffs.git
synced 2026-10-17 13:17:40 +00:00
Truncate function presumes too few free pages #49
This commit is contained in:
@@ -1402,7 +1402,8 @@ s32_t spiffs_object_truncate(
|
||||
s32_t res = SPIFFS_OK;
|
||||
spiffs *fs = fd->fs;
|
||||
|
||||
res = spiffs_gc_check(fs, remove ? 0 : SPIFFS_DATA_PAGE_SIZE(fs));
|
||||
// need 2 pages if not removing: object index page + possibly chopped data page
|
||||
res = spiffs_gc_check(fs, remove ? 0 : SPIFFS_DATA_PAGE_SIZE(fs) * 2);
|
||||
SPIFFS_CHECK_RES(res);
|
||||
|
||||
spiffs_page_ix objix_pix = fd->objix_hdr_pix;
|
||||
|
||||
Reference in New Issue
Block a user