-
Notifications
You must be signed in to change notification settings - Fork 1.5k
vfs/fs_stat: set st_size on EEPROM character drivers #17264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@ajuckler I approved assuming you will submit the requested Documentation/ |
a4f608e to
77765e7
Compare
77765e7 to
798e94f
Compare
798e94f to
7f1339c
Compare
acassis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty good Documentation! Thank you!
Add EEPIOC_GEOMETRY IOCTL command to retrieve the EEPROM geometry. Signed-off-by: Antoine Juckler <6445757+ajuckler@users.noreply.github.com>
It acts as register_driver but also populates the inode size. This allows to return a non-zero size when calling stat() on an eeprom driver. The conditions (CONFIG_PSEUDOFS_FILE or CONFIG_FS_SHMFS) for the declaration of the inode size field have also been removed so that other drivers can populate this field in the future. Signed-off-by: Antoine Juckler <6445757+ajuckler@users.noreply.github.com>
Fix writing till the very last byte of the memory Signed-off-by: Antoine Juckler <6445757+ajuckler@users.noreply.github.com>
6a3aec5
7f1339c to
6a3aec5
Compare
|
@acassis @xiaoxiang781216 The following has been tested on spi_xx25xx (in addition to the losetup):
|
Summary
The NuttX documentation states that it is possible to use an EEPROM character driver with a file system by converting it to a block device using the loop device (
losetup). However,losetup()fails with messageFile is too small for blocksizebecause thest_sizefield is not populated by thestat()function when used on character drivers.This MR fixes this error by:
st_sizefield onstat().Impact
The
eeprom_25xx_eenum contents have changed due to the addition of the sector size.Testing
Tested on a custom target (STM32F7-based) with a Rhom BR25G256FVT EEPROM (equivalent to a Microchip 25xx256).
Following piece of code would fail before the changes in fs_stat: