xiaoxiang781216 commented on code in PR #8496: URL: https://github.com/apache/nuttx/pull/8496#discussion_r1103548652
########## fs/littlefs/Kconfig: ########## @@ -6,17 +6,81 @@ config FS_LITTLEFS Build the LITTLEFS file system. https://github.com/littlefs-project/littlefs. if FS_LITTLEFS +config FS_LITTLEFS_ADVANCED_BLOCK_DEVICE_CFG + bool "Enable full block device configuration" + default n + ---help--- + This enables full control over configuring read, program, block, cache, + lookahead sizes and block count. + +if !FS_LITTLEFS_ADVANCED_BLOCK_DEVICE_CFG 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. - + Configure the cache size of the LittleFS file system with a multiple factor of the block size. +endif + config FS_LITTLEFS_BLOCK_CYCLE - int "LITTLEFS Block Cycle" + int "Block cycle" default 200 ---help--- - Configure the block cycle of the LITTLEFS file system. + Number of erase cycles before Littlefs evicts metadata logs and moves + the metadata to another block. Suggested values are in the + range 100-1000, with large values having better performance at the cost + of less consistent wear distribution. + + Set to -1 to disable block-level wear-leveling (recommended for RAM and FRAM). + +if FS_LITTLEFS_ADVANCED_BLOCK_DEVICE_CFG +config FS_LITTLEFS_READ_SIZE + int "Read size" + default 16 + ---help--- + Minimum size of a block read in bytes. All read operations will be a + multiple of this value. + +config FS_LITTLEFS_PROGRAM_SIZE + int "Program size" + default 16 + ---help--- + Minimum size of a block program in bytes. All program operations will be + a multiple of this value + +config FS_LITTLEFS_BLOCK_SIZE + int "Block size" + default 4096 + ---help--- + Size of an erasable block in bytes. This does not impact ram consumption + and may be larger than the physical erase size. However, non-inlined + files take up at minimum one block. Must be a multiple of the read and + program sizes. + +config FS_LITTLEFS_BLOCK_COUNT + int "Block count" + default 128 Review Comment: it isn't good to bypass the value reported by mtd_geometry_s. The better approach is that: 1. mtd driver report the physical property which match the hardware requirement 2. littlefs Kconfig add xxx_FACTOR to multiply the value reported item 1 for speed tuning, the default should match the hardware property 3. Compute block count from item 2 plus mtd_geometry_s It's wrong to add Kconfig option which can be computed from other value, like FS_LITTLEFS_BLOCK_COUNT. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org