patacongo commented on a change in pull request #2861:
URL: https://github.com/apache/incubator-nuttx/pull/2861#discussion_r577623074



##########
File path: include/nuttx/fs/fs.h
##########
@@ -206,11 +206,11 @@ struct file_operations
 #ifndef CONFIG_DISABLE_MOUNTPOINT
 struct geometry
 {
-  bool   geo_available;    /* true: The device is available */
-  bool   geo_mediachanged; /* true: The media has changed since last query */
-  bool   geo_writeenabled; /* true: It is okay to write to this device */
-  size_t geo_nsectors;     /* Number of sectors on the device */
-  size_t geo_sectorsize;   /* Size of one sector */
+  bool     geo_available;    /* true: The device is available */
+  bool     geo_mediachanged; /* true: The media has changed since last query */
+  bool     geo_writeenabled; /* true: It is okay to write to this device */
+  uint32_t geo_nsectors;     /* Number of sectors on the device */
+  uint32_t geo_sectorsize;   /* Size of one sector */

Review comment:
       > 
   > 
   > > @codebje if we just change these two fields, how can eZ80 read the file 
at the end of SD card if other FS functions still use off_t/size_t? Can we 
change size_t to 32bit on eZ80 instead?
   > 
   > off_t would probably be a better choice than uint32_t. off_t is the type 
is is large enough to hold any file system offset (off_t and off64_t for large 
files). It is intended for file system offsets and sizes. And, unlike size_t, 
off_t does not change with CPU architecture. It is always int32_t. It must be 
signed because (off_t)-1 is returned by some functions on error conditions.
   
       183 /* blkcnt_t and off_t are signed integer types.
       184  *
       185  *   blkcnt_t is used for file block counts.
       186  *   off_t is used for file offsets and sizes.
       187  *   fpos_t is used for file positions.
       188  *
       189  * Hence, all should be independent of processor architecture.
       190  */
       191
       192 typedef uint32_t     blkcnt_t;
       193 typedef int32_t      off_t;
       194 typedef off_t        fpos_t;
       195
       196 #ifdef CONFIG_HAVE_LONG_LONG
       197 /* Large file versions */
       198
       199 typedef int64_t      off64_t;
       200 typedef int64_t      fpos64_t;
       201 #endif
   
   Hmmm... actually the standard type blkcnt_t which is always uint32_t would 
be the best choice for geo_nsectors since blkcnt_t is intended to represent the 
number of sectors/blocks.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to