fs/littlefs: improve littlefs flash block erase balance performance
This commit is contained in:
parent
5b350f3a0f
commit
21316466d2
@ -3,4 +3,18 @@ config FS_LITTLEFS
|
|||||||
default n
|
default n
|
||||||
depends on !DISABLE_MOUNTPOINT
|
depends on !DISABLE_MOUNTPOINT
|
||||||
---help---
|
---help---
|
||||||
Build the LITTLEFS file system. https://github.com/ARMmbed/littlefs.
|
Build the LITTLEFS file system. https://github.com/littlefs-project/littlefs.
|
||||||
|
|
||||||
|
if FS_LITTLEFS
|
||||||
|
config FS_LITTLEFS_BLOCK_FACTOR
|
||||||
|
int "LITTLEFS Block size multiple factor"
|
||||||
|
default 4
|
||||||
|
---help---
|
||||||
|
Configure the cache size of the LITTLEFS file system with a multiple factor of the block size.
|
||||||
|
|
||||||
|
config FS_LITTLEFS_BLOCK_CYCLE
|
||||||
|
int "LITTLEFS Block Cycle"
|
||||||
|
default 200
|
||||||
|
---help---
|
||||||
|
Configure the block cycle of the LITTLEFS file system.
|
||||||
|
endif
|
||||||
|
@ -1019,12 +1019,14 @@ static int littlefs_bind(FAR struct inode *driver, FAR const void *data,
|
|||||||
fs->cfg.prog = littlefs_write_block;
|
fs->cfg.prog = littlefs_write_block;
|
||||||
fs->cfg.erase = littlefs_erase_block;
|
fs->cfg.erase = littlefs_erase_block;
|
||||||
fs->cfg.sync = littlefs_sync_block;
|
fs->cfg.sync = littlefs_sync_block;
|
||||||
fs->cfg.read_size = fs->geo.blocksize;
|
fs->cfg.read_size = fs->geo.blocksize *
|
||||||
|
CONFIG_FS_LITTLEFS_BLOCK_FACTOR;
|
||||||
fs->cfg.prog_size = fs->geo.blocksize;
|
fs->cfg.prog_size = fs->geo.blocksize;
|
||||||
fs->cfg.block_size = fs->geo.erasesize;
|
fs->cfg.block_size = fs->geo.erasesize;
|
||||||
fs->cfg.block_count = fs->geo.neraseblocks;
|
fs->cfg.block_count = fs->geo.neraseblocks;
|
||||||
fs->cfg.block_cycles = 500;
|
fs->cfg.block_cycles = CONFIG_FS_LITTLEFS_BLOCK_CYCLE;
|
||||||
fs->cfg.cache_size = fs->geo.blocksize;
|
fs->cfg.cache_size = fs->geo.blocksize *
|
||||||
|
CONFIG_FS_LITTLEFS_BLOCK_FACTOR;
|
||||||
fs->cfg.lookahead_size = lfs_min(lfs_alignup(fs->cfg.block_count, 64) / 8,
|
fs->cfg.lookahead_size = lfs_min(lfs_alignup(fs->cfg.block_count, 64) / 8,
|
||||||
fs->cfg.read_size);
|
fs->cfg.read_size);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user