mufs: erase during block allocation

tags/0.1.0
S.J.R. van Schaik 8 years ago
parent 07e6cadae9
commit 23c861eab5
  1. 4
      source/fs/mufs/block.c

@ -72,6 +72,8 @@ int mufs_alloc_block(struct mufs *fs, uint32_t *found)
if ((index = mufs_next_free_block(fs)) == SIZE_MAX)
return -1;
flash_erase(fs->dev, index, 1);
*found = index;
return mufs_mark_block(fs, index, 1);
@ -87,7 +89,5 @@ int mufs_free_block(struct mufs *fs, uint32_t block)
if (block < 1 + nbitmap_size)
return -1;
flash_erase(fs->dev, block, 1);
return mufs_mark_block(fs, block, 0);
}

Loading…
Cancel
Save