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


##########
include/nuttx/fs/fs.h:
##########
@@ -209,13 +211,19 @@ struct file_operations
   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);
+                    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);
+  int     (*mmap)(FAR struct file *filep, FAR void **addr, off_t start,
+                  size_t length);
+  int     (*munmap)(FAR struct task_group_s *group, FAR struct mm_map_s *map,

Review Comment:
   I don't like storing the group into mm_map_s. Since the mm_map_s is stored 
inside the group, there is no point in wasting memory by storing it; it has to 
be the same :)
   
   Just indicating somehow that the process is about the exit and the current 
address evironment should not be touched is enough for the munmap call. In this 
case the driver needs to do all the cleanup (kmm_free etc.), but not touch 
group specific things like real MMU mappings.
   
   A simple way to do this is to just either pass the current "group" or NULL 
to the unmap.
   
   



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