fatfs: fstat - enable setting a custom preferred block size

Enables setting a custom st_blksize in fatfs vfs fstat function.
Directly affects file buffer size for fatfs.
Increasing the value helps with fread and fgets speeds, however increases heap usage.
Added info to docs about improving I/O performance.
This commit is contained in:
Adam Múdry
2023-02-28 01:50:31 +01:00
committed by Martin Vychodil
parent 7dd7498212
commit 16915556a3
5 changed files with 34 additions and 0 deletions

View File

@@ -600,6 +600,7 @@ static int vfs_fat_fstat(void* ctx, int fd, struct stat * st)
st->st_mtime = 0;
st->st_atime = 0;
st->st_ctime = 0;
st->st_blksize = CONFIG_FATFS_VFS_FSTAT_BLKSIZE;
return 0;
}