RTEMS | imfs/imfs_statvfs: Added the statvfs functionality (!504)

Joel Sherrill (@joel) gitlab at rtems.org
Tue Jun 10 20:36:37 UTC 2025



Merge request https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/504 was reviewed by Joel Sherrill

--
  
Joel Sherrill started a new discussion on cpukit/include/rtems/imfs.h: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/504#note_123420

 >    const char *target
 >  );
 > +extern int IMFS_statvfs(

This should have a Doxygen comment block above it.

--
  
Joel Sherrill started a new discussion on cpukit/libfs/src/imfs/imfs_statvfs.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/504#note_123421

 > +  buf->f_blocks = UINT_MAX / IMFS_MEMFILE_BYTES_PER_BLOCK;
 > +  buf->f_bfree = malloc_free_space() / IMFS_MEMFILE_BYTES_PER_BLOCK;
 > +  buf->f_bavail;

These lines without "=" do nothing.

--
  
Joel Sherrill started a new discussion on testsuites/psxtests/psximfs01/init.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/504#note_123422

 >  #define CONFIGURE_MAXIMUM_TASKS             1
 > -#define CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK 16
 > +#define CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK 512

This broke the test. The configured block size needs to be small so the test can write a file that uses all the blocks that can be associated with a file. At 16 bytes, this is possible. At 512 bytes, this requires about 1GB RAM. This is likely in the docs where the configuration parameter is discussed but is in the [code](https://gitlab.rtems.org/rtems/rtos/rtems/-/blob/main/cpukit/include/rtems/imfs.h?ref_type=heads#L63).

--
  
Joel Sherrill started a new discussion on testsuites/psxtests/psximfs01/init.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/504#note_123423

 >    open_it(false, true);
 > +
 > +  int success = statvfs(FILE_NAME, &imfs_statvfs);

Change this to be in a subroutine. Minimize output and be sure to use rtems_test_assert() on the return code and expected structure elements.


-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/504
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20250610/68cc452c/attachment-0001.htm>


More information about the bugs mailing list