mirror of
https://github.com/apache/nuttx.git
synced 2026-05-25 01:39:44 +08:00
fs/littlefs: improve littlefs flash block erase balance performance
This commit is contained in:
+15
-1
@@ -3,4 +3,18 @@ config FS_LITTLEFS
|
||||
default n
|
||||
depends on !DISABLE_MOUNTPOINT
|
||||
---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.erase = littlefs_erase_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.block_size = fs->geo.erasesize;
|
||||
fs->cfg.block_count = fs->geo.neraseblocks;
|
||||
fs->cfg.block_cycles = 500;
|
||||
fs->cfg.cache_size = fs->geo.blocksize;
|
||||
fs->cfg.block_cycles = CONFIG_FS_LITTLEFS_BLOCK_CYCLE;
|
||||
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.read_size);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user