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 2022/02/06 00:30:31 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 opened a new pull request #5425: drivers/pipe: Remove pipe from file system after open

xiaoxiang781216 opened a new pull request #5425:
URL: https://github.com/apache/incubator-nuttx/pull/5425


   ## Summary
   
   ## 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] [incubator-nuttx] xiaoxiang781216 merged pull request #5425: drivers/pipe: Remove pipe from file system after open

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #5425:
URL: https://github.com/apache/incubator-nuttx/pull/5425


   


-- 
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] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5425: drivers/pipe: Remove pipe from file system after open

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5425:
URL: https://github.com/apache/incubator-nuttx/pull/5425#discussion_r800220542



##########
File path: drivers/pipes/pipe.c
##########
@@ -155,69 +131,34 @@ static int pipe_register(size_t bufsize, int flags,
   int pipeno;
   int ret;
 
-  /* Get exclusive access to the pipe allocation data */
-
-  ret = nxsem_wait(&g_pipesem);
-  if (ret < 0)
-    {
-      goto errout;
-    }
-
   /* Allocate a minor number for the pipe device */
 
   pipeno = pipe_allocate();
   if (pipeno < 0)
     {
-      ret = pipeno;
-      goto errout_with_sem;
+      return pipeno;
     }
 
   /* Create a pathname to the pipe device */
 
   snprintf(devname, namesize, CONFIG_DEV_PIPE_VFS_PATH"/%d", pipeno);
 
-  /* Check if the pipe device has already been created */
+  /* Allocate and initialize a new device structure instance */
 
-  if ((g_pipecreated & (1 << pipeno)) == 0)
+  dev = pipecommon_allocdev(bufsize);
+  if (!dev)

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] [incubator-nuttx] pkarashchenko commented on a change in pull request #5425: drivers/pipe: Remove pipe from file system after open

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5425:
URL: https://github.com/apache/incubator-nuttx/pull/5425#discussion_r800181567



##########
File path: drivers/pipes/pipe.c
##########
@@ -68,14 +62,10 @@ static const struct file_operations pipe_fops =
   NULL,                /* seek */
   pipecommon_ioctl,    /* ioctl */
   pipecommon_poll      /* poll */
-#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
-  , pipecommon_unlink  /* unlink */
-#endif
 };
 
-static sem_t  g_pipesem       = SEM_INITIALIZER(1);
-static uint32_t g_pipeset     = 0;
-static uint32_t g_pipecreated = 0;
+static sem_t g_pipesem = SEM_INITIALIZER(1);
+static int   g_pipeno  = 0;

Review comment:
       ```suggestion
   static int   g_pipeno;
   ```
   




-- 
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] [incubator-nuttx] xiaoxiang781216 closed pull request #5425: drivers/pipe: Remove pipe from file system after open

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 closed pull request #5425:
URL: https://github.com/apache/incubator-nuttx/pull/5425


   


-- 
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] [incubator-nuttx] xiaoxiang781216 commented on pull request #5425: drivers/pipe: Remove pipe from file system after open

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #5425:
URL: https://github.com/apache/incubator-nuttx/pull/5425#issuecomment-1031049743


   Let's do in the next PR.


-- 
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] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5425: drivers/pipe: Remove pipe from file system after open

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5425:
URL: https://github.com/apache/incubator-nuttx/pull/5425#discussion_r800197891



##########
File path: drivers/pipes/pipe.c
##########
@@ -68,14 +62,10 @@ static const struct file_operations pipe_fops =
   NULL,                /* seek */
   pipecommon_ioctl,    /* ioctl */
   pipecommon_poll      /* poll */
-#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
-  , pipecommon_unlink  /* unlink */
-#endif
 };
 
-static sem_t  g_pipesem       = SEM_INITIALIZER(1);
-static uint32_t g_pipeset     = 0;
-static uint32_t g_pipecreated = 0;
+static sem_t g_pipesem = SEM_INITIALIZER(1);
+static int   g_pipeno  = 0;

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] [incubator-nuttx] pkarashchenko commented on a change in pull request #5425: drivers/pipe: Remove pipe from file system after open

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5425:
URL: https://github.com/apache/incubator-nuttx/pull/5425#discussion_r800217386



##########
File path: drivers/pipes/pipe.c
##########
@@ -155,69 +131,34 @@ static int pipe_register(size_t bufsize, int flags,
   int pipeno;
   int ret;
 
-  /* Get exclusive access to the pipe allocation data */
-
-  ret = nxsem_wait(&g_pipesem);
-  if (ret < 0)
-    {
-      goto errout;
-    }
-
   /* Allocate a minor number for the pipe device */
 
   pipeno = pipe_allocate();
   if (pipeno < 0)
     {
-      ret = pipeno;
-      goto errout_with_sem;
+      return pipeno;
     }
 
   /* Create a pathname to the pipe device */
 
   snprintf(devname, namesize, CONFIG_DEV_PIPE_VFS_PATH"/%d", pipeno);
 
-  /* Check if the pipe device has already been created */
+  /* Allocate and initialize a new device structure instance */
 
-  if ((g_pipecreated & (1 << pipeno)) == 0)
+  dev = pipecommon_allocdev(bufsize);
+  if (!dev)

Review comment:
       ```suggestion
     if (dev = NULL)
   ```




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