Browse Source

compact when dir count hits 0x3ff

David 3 months ago
parent
commit
172a186fa9
1 changed files with 4 additions and 0 deletions
  1. 4 0
      lfs.c

+ 4 - 0
lfs.c

@@ -2333,6 +2333,10 @@ static int lfs_dir_relocatingcommit(lfs_t *lfs, lfs_mdir_t *dir,
         lfs->gdisk = lfs->gstate;
         lfs->gdelta = (lfs_gstate_t){0};
 
+        if(dir->count == 0x3ff)
+        {
+            goto compact;
+        }
         goto fixmlist;
     }