From 41ed2e153a5d7da60b492ae3689b4c83ccf19d89 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Tue, 19 Mar 2019 08:21:17 -0600 Subject: [PATCH] fs/littlefs/lfs_vfs.c: Lookahead should use bit unit not byte unit. --- fs/littlefs/lfs_vfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/littlefs/lfs_vfs.c b/fs/littlefs/lfs_vfs.c index 75027fcac52..bf812d50c1c 100644 --- a/fs/littlefs/lfs_vfs.c +++ b/fs/littlefs/lfs_vfs.c @@ -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