ajuckler commented on code in PR #17264:
URL: https://github.com/apache/nuttx/pull/17264#discussion_r2484395641
##########
fs/vfs/fs_stat.c:
##########
@@ -439,6 +440,27 @@ int inode_stat(FAR struct inode *inode, FAR struct stat
*buf, int resolve)
#endif
{
buf->st_mode |= S_IFCHR;
+
+ /* If it is an EEPROM driver, populate the st_size as well (to
+ * allow exporting it as filemtd or loop device)
+ */
+
+ if (inode->u.i_ops->ioctl != NULL)
Review Comment:
The EEPROM drivers don't have access to the inode properties until they are
open. I could populate the field on open, but `stat` can also be called on
non-open files so this is not viable.
Alternatively, I could call `find_driver` after the `register_driver` calls
in the `_initialize` functions, and then assign the i_size. What do you think?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]