vfs/lfs: Simplify the lookahead_size equation

the final result is same(keep 8 bytes alignment)

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I664879960c898a7f1518236b24a2b3ee8a9998d0
This commit is contained in:
Xiang Xiao 2021-03-29 13:58:03 +08:00 committed by Abdelatif Guettouche
parent 9f44417de4
commit 866fe646aa
1 changed files with 2 additions and 3 deletions

View File

@ -1023,9 +1023,8 @@ static int littlefs_bind(FAR struct inode *driver, FAR const void *data,
fs->cfg.block_count = fs->geo.neraseblocks;
fs->cfg.block_cycles = 500;
fs->cfg.cache_size = fs->geo.blocksize;
fs->cfg.lookahead_size =
lfs_min(lfs_alignup((fs->cfg.block_count + 7) / 8, 8),
fs->cfg.read_size);
fs->cfg.lookahead_size = lfs_min(lfs_alignup(fs->cfg.block_count, 64) / 8,
fs->cfg.read_size);
/* Then get information about the littlefs filesystem on the devices
* managed by this driver.