提交 21b8473c 编写于 作者: F Far

Feature: fatfs scandir format optimization

Change-Id: I5ccc7f115cf5f989bd2a2580dcfe4f596bf973a0
上级 08ca99d0
...@@ -113,7 +113,8 @@ int bchlib_readsector(FAR struct bchlib_s *bch, unsigned long long sector) ...@@ -113,7 +113,8 @@ int bchlib_readsector(FAR struct bchlib_s *bch, unsigned long long sector)
} }
bch->sector = (unsigned long long)-1; bch->sector = (unsigned long long)-1;
ret = los_disk_read(bch->disk->disk_id, (FAR void *)bch->buffer, sector, 1); /* useRead is set TRUE, it'll use read block for not reading large data */
ret = los_disk_read(bch->disk->disk_id, (FAR void *)bch->buffer, sector, 1, TRUE);
if (ret < 0) if (ret < 0)
{ {
PRINTK("Read failed: %d\n", ret); PRINTK("Read failed: %d\n", ret);
......
...@@ -159,7 +159,8 @@ ssize_t bchlib_read(FAR void *handle, FAR char *buffer, loff_t offset, size_t le ...@@ -159,7 +159,8 @@ ssize_t bchlib_read(FAR void *handle, FAR char *buffer, loff_t offset, size_t le
{ {
nsectors = bch->nsectors - sector; nsectors = bch->nsectors - sector;
} }
ret = los_disk_read(bch->disk->disk_id, (FAR void *)buffer, sector + bch->sectstart, nsectors); /* No need for reading large contiguous data, useRead(param 4) is set TRUE */
ret = los_disk_read(bch->disk->disk_id, (FAR void *)buffer, sector + bch->sectstart, nsectors, TRUE);
if (ret < 0) if (ret < 0)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册