jlaitine commented on code in PR #8000:
URL: https://github.com/apache/nuttx/pull/8000#discussion_r1059596447


##########
include/nuttx/fs/fs.h:
##########
@@ -206,16 +207,21 @@ struct file_operations
    * treated like unions.
    */
 
-  int     (*close)(FAR struct file *filep);
-  ssize_t (*read)(FAR struct file *filep, FAR char *buffer, size_t buflen);
-  ssize_t (*write)(FAR struct file *filep, FAR const char *buffer,
-                   size_t buflen);
-  off_t   (*seek)(FAR struct file *filep, off_t offset, int whence);
-  int     (*ioctl)(FAR struct file *filep, int cmd, unsigned long arg);
+  int      (*close)(FAR struct file *filep);
+  ssize_t  (*read)(FAR struct file *filep, FAR char *buffer, size_t buflen);
+  ssize_t  (*write)(FAR struct file *filep, FAR const char *buffer,
+                    size_t buflen);
+  off_t    (*seek)(FAR struct file *filep, off_t offset, int whence);
+  int      (*ioctl)(FAR struct file *filep, int cmd, unsigned long arg);
+  int      (*truncate)(FAR struct file *filep, off_t length);
+  FAR void *(*mmap)(FAR struct file *filep, off_t start, size_t length);
+  int      (*munmap)(FAR struct task_group_s *group, FAR struct inode *inode,

Review Comment:
   Done; 
   
   I think that with mm_map_s having a "priv" pointer it is better to also 
create the mm_map_s where the actual mapping is done, and add it to the group's 
data structure there. Hence it is not needed as a parameter to mmap. So, I 
added it as a parameter to munmap and mmap just updates the caller's data 
pointer and returns the error value. This also fits better to current 
_file_mmap function.
   
   I can provide the actual "munmap" support with mm_map implemented as a 
linked list soon after we get this PR finished
   



-- 
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: commits-unsubscr...@nuttx.apache.org

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

Reply via email to