Feature: Fatfs scandir format and mmcblk read/write optimization

1. Bcache block with high mem address is after lower mem address in RCU list when initing bcache.
2. Format will clear the bcache before writing the FAT.
3. The fatfs_readdir use the bcache writing block to reduce the chance of data switching out
4. Add performance analysing macron switch

Change-Id: I8fbc48418509d2e660d725d2c265266e931c26f8
This commit is contained in:
Far
2021-04-14 10:31:05 +08:00
parent b9a4f8b3f1
commit beca52b61b
6 changed files with 131 additions and 14 deletions
+3 -2
View File
@@ -1372,7 +1372,8 @@ int fatfs_readdir(struct Vnode *vp, struct fs_dirent_s *idir)
DEF_NAMBUF;
INIT_NAMBUF(fs);
for (i = 0; i < idir->read_cnt; i++) {
result = dir_read(dp, 0);
/* using dir_read_massive to promote performance */
result = dir_read_massive(dp, 0);
if (result == FR_NO_FILE) {
break;
} else if (result != FR_OK) {
@@ -1596,7 +1597,7 @@ static int fatfs_set_part_info(los_part *part)
return -ENOMEM;
}
(void)memset_s(buf, disk->sector_size, 0, disk->sector_size);
ret = los_disk_read(part->disk_id, buf, 0, 1);
ret = los_disk_read(part->disk_id, buf, 0, 1, TRUE); /* TRUE when not reading large data */
if (ret < 0) {
free(buf);
return -EIO;