fs/littlefs/lfs_vfs.c: Lookahead should use bit unit not byte unit.

This commit is contained in:
Xiang Xiao
2019-03-19 08:21:17 -06:00
committed by Gregory Nutt
parent aaa2630f9a
commit 41ed2e153a
+3 -3
View File
@@ -940,11 +940,11 @@ static int littlefs_bind(FAR struct inode *driver, FAR const void *data,
fs->cfg.prog_size = fs->geo.blocksize;
fs->cfg.block_size = fs->geo.erasesize;
fs->cfg.block_count = fs->geo.neraseblocks;
fs->cfg.lookahead = 4 * ((fs->cfg.block_count + 31) / 32);
fs->cfg.lookahead = 32 * ((fs->cfg.block_count + 31) / 32);
if (fs->cfg.lookahead > fs->cfg.read_size)
if (fs->cfg.lookahead > 32 * fs->cfg.read_size)
{
fs->cfg.lookahead = fs->cfg.read_size;
fs->cfg.lookahead = 32 * fs->cfg.read_size;
}
/* Then get information about the littlefs filesystem on the devices