You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2023/01/02 17:17:47 UTC

[GitHub] [nuttx] xiaoxiang781216 opened a new pull request, #8021: fs: Move mmap callback before truncate in [file|mountpt]_operations

xiaoxiang781216 opened a new pull request, #8021:
URL: https://github.com/apache/nuttx/pull/8021

   ## Summary
   since mmap may exist in block_operations, but truncate may not, moving mmap beforee truncate could make three struct more compatible
   
   ## Impact
   
   ## Testing
   
   


-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] pkarashchenko merged pull request #8021: fs: Move mmap callback before truncate in [file|mountpt]_operations

Posted by GitBox <gi...@apache.org>.
pkarashchenko merged PR #8021:
URL: https://github.com/apache/nuttx/pull/8021


-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] pkarashchenko commented on a diff in pull request #8021: fs: Move mmap callback before truncate in [file|mountpt]_operations

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #8021:
URL: https://github.com/apache/nuttx/pull/8021#discussion_r1061010646


##########
drivers/video/video.c:
##########
@@ -3200,13 +3206,16 @@ static int video_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
 
 static int video_mmap(FAR struct file *filep, FAR struct mm_map_entry_s *map)
 {
-  FAR struct inode *inode = filep->f_inode;
-  FAR video_mng_t  *priv  = (FAR video_mng_t *)inode->i_private;
+  FAR struct inode     *inode    = filep->f_inode;
+  FAR video_mng_t      *priv     = (FAR video_mng_t *)inode->i_private;
+  FAR video_type_inf_t *type_inf = &priv->video_inf;
+  size_t heapsize = get_heapsize(type_inf);

Review Comment:
   either align with above of remove spaces from above.



##########
fs/nxffs/nxffs_initialize.c:
##########
@@ -54,12 +54,12 @@ const struct mountpt_operations nxffs_operations =
   nxffs_write,       /* write */
   NULL,              /* seek -- Use f_pos in struct file */
   nxffs_ioctl,       /* ioctl */
+  NULL,              /* mmap */
 #ifdef __NO_TRUNCATE_SUPPORT__

Review Comment:
   Just note here:
   I can't find how `__NO_TRUNCATE_SUPPORT__` can be enabled. Should we clean it up?



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #8021: fs: Move mmap callback before truncate in [file|mountpt]_operations

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8021:
URL: https://github.com/apache/nuttx/pull/8021#discussion_r1061389789


##########
fs/rpmsgfs/rpmsgfs.c:
##########
@@ -161,8 +161,8 @@ const struct mountpt_operations rpmsgfs_operations =
   rpmsgfs_write,         /* write */
   rpmsgfs_seek,          /* seek */
   rpmsgfs_ioctl,         /* ioctl */
-  rpmsgfs_ftruncate,     /* ftruncate */
   NULL,                  /* mmap */
+  rpmsgfs_ftruncate,     /* ftruncate */

Review Comment:
   Done.



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #8021: fs: Move mmap callback before truncate in [file|mountpt]_operations

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8021:
URL: https://github.com/apache/nuttx/pull/8021#discussion_r1061390737


##########
arch/arm/src/sama5/sam_tsd.c:
##########
@@ -249,8 +249,8 @@ static const struct file_operations g_tsdops =
   NULL,            /* write */
   NULL,            /* seek */
   sam_tsd_ioctl,   /* ioctl */
-  NULL,            /* truncate */
   NULL,            /* mmap */
+  NULL,            /* truncate */
   sam_tsd_poll     /* poll */
 #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
   , NULL           /* unlink */

Review Comment:
   Done.



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #8021: fs: Move mmap callback before truncate in [file|mountpt]_operations

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8021:
URL: https://github.com/apache/nuttx/pull/8021#discussion_r1061096101


##########
fs/nxffs/nxffs_initialize.c:
##########
@@ -54,12 +54,12 @@ const struct mountpt_operations nxffs_operations =
   nxffs_write,       /* write */
   NULL,              /* seek -- Use f_pos in struct file */
   nxffs_ioctl,       /* ioctl */
+  NULL,              /* mmap */
 #ifdef __NO_TRUNCATE_SUPPORT__

Review Comment:
   Look like this is partial work @patacongo left:
   https://github.com/apache/nuttx/blob/master/fs/nxffs/README.txt#L187-L191



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #8021: fs: Move mmap callback before truncate in [file|mountpt]_operations

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8021:
URL: https://github.com/apache/nuttx/pull/8021#discussion_r1061097503


##########
drivers/video/video.c:
##########
@@ -3200,13 +3206,16 @@ static int video_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
 
 static int video_mmap(FAR struct file *filep, FAR struct mm_map_entry_s *map)
 {
-  FAR struct inode *inode = filep->f_inode;
-  FAR video_mng_t  *priv  = (FAR video_mng_t *)inode->i_private;
+  FAR struct inode     *inode    = filep->f_inode;
+  FAR video_mng_t      *priv     = (FAR video_mng_t *)inode->i_private;
+  FAR video_type_inf_t *type_inf = &priv->video_inf;
+  size_t heapsize = get_heapsize(type_inf);

Review Comment:
   Done.



-- 
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-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] pkarashchenko commented on a diff in pull request #8021: fs: Move mmap callback before truncate in [file|mountpt]_operations

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #8021:
URL: https://github.com/apache/nuttx/pull/8021#discussion_r1061201208


##########
fs/rpmsgfs/rpmsgfs.c:
##########
@@ -161,8 +161,8 @@ const struct mountpt_operations rpmsgfs_operations =
   rpmsgfs_write,         /* write */
   rpmsgfs_seek,          /* seek */
   rpmsgfs_ioctl,         /* ioctl */
-  rpmsgfs_ftruncate,     /* ftruncate */
   NULL,                  /* mmap */
+  rpmsgfs_ftruncate,     /* ftruncate */

Review Comment:
   ```suggestion
     rpmsgfs_ftruncate,     /* truncate */
   ```
   



##########
arch/arm/src/sama5/sam_tsd.c:
##########
@@ -249,8 +249,8 @@ static const struct file_operations g_tsdops =
   NULL,            /* write */
   NULL,            /* seek */
   sam_tsd_ioctl,   /* ioctl */
-  NULL,            /* truncate */
   NULL,            /* mmap */
+  NULL,            /* truncate */
   sam_tsd_poll     /* poll */
 #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
   , NULL           /* unlink */

Review Comment:
   @xiaoxiang781216 could you please rebase the PR? I think all those ending NULLs should be removed now.



-- 
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-unsubscribe@nuttx.apache.org

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