nuttx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gn...@apache.org
Subject [incubator-nuttx] 05/09: fs/vfs: Rename fdesc_poll to fs_poll
Date Sun, 03 May 2020 18:16:10 GMT
This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 4c680bfadc20847190e34729f3dd7f22f7d7dee6
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
AuthorDate: Sun May 3 17:02:31 2020 +0800

    fs/vfs: Rename fdesc_poll to fs_poll
    
    and reorder the function declaration
    
    Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
---
 fs/vfs/fs_poll.c      |   6 +-
 include/nuttx/fs/fs.h | 218 +++++++++++++++++++++++++-------------------------
 2 files changed, 112 insertions(+), 112 deletions(-)

diff --git a/fs/vfs/fs_poll.c b/fs/vfs/fs_poll.c
index da3a2bc..737d9d3 100644
--- a/fs/vfs/fs_poll.c
+++ b/fs/vfs/fs_poll.c
@@ -105,7 +105,7 @@ static int poll_fdsetup(int fd, FAR struct pollfd *fds, bool setup)
         }
     }
 
-  return fdesc_poll(fd, fds, setup);
+  return fs_poll(fd, fds, setup);
 }
 
 /****************************************************************************
@@ -299,7 +299,7 @@ static inline int poll_teardown(FAR struct pollfd *fds, nfds_t nfds,
  *
  * Description:
  *   Low-level poll operation based on struct file.  This is used both to (1)
- *   support detached file, and also (2) by fdesc_poll() to perform all
+ *   support detached file, and also (2) by fs_poll() to perform all
  *   normal operations on file descriptors.
  *
  * Input Parameters:
@@ -378,7 +378,7 @@ int file_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup)
  *
  ****************************************************************************/
 
-int fdesc_poll(int fd, FAR struct pollfd *fds, bool setup)
+int fs_poll(int fd, FAR struct pollfd *fds, bool setup)
 {
   FAR struct file *filep;
   int ret;
diff --git a/include/nuttx/fs/fs.h b/include/nuttx/fs/fs.h
index 91147d9..4221d85 100644
--- a/include/nuttx/fs/fs.h
+++ b/include/nuttx/fs/fs.h
@@ -717,23 +717,20 @@ void files_initlist(FAR struct filelist *list);
 void files_releaselist(FAR struct filelist *list);
 
 /****************************************************************************
- * Name: file_dup2
+ * Name: file_dup
  *
  * Description:
- *   Assign an inode to a specific files structure.  This is the heart of
- *   dup2.
- *
- *   Equivalent to the non-standard fs_dupfd2() function except that it
- *   accepts struct file instances instead of file descriptors and it does
+ *   Equivalent to the non-standard fs_dupfd() function except that it
+ *   accepts a struct file instance instead of a file descriptor and does
  *   not set the errno variable.
  *
  * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is return on
+ *   Zero (OK) is returned on success; a negated errno value is returned on
  *   any failure.
  *
  ****************************************************************************/
 
-int file_dup2(FAR struct file *filep1, FAR struct file *filep2);
+int file_dup(FAR struct file *filep, int minfd);
 
 /****************************************************************************
  * Name: fs_dupfd OR dup
@@ -758,20 +755,23 @@ int file_dup2(FAR struct file *filep1, FAR struct file *filep2);
 int fs_dupfd(int fd, int minfd);
 
 /****************************************************************************
- * Name: file_dup
+ * Name: file_dup2
  *
  * Description:
- *   Equivalent to the non-standard fs_dupfd() function except that it
- *   accepts a struct file instance instead of a file descriptor and does
+ *   Assign an inode to a specific files structure.  This is the heart of
+ *   dup2.
+ *
+ *   Equivalent to the non-standard fs_dupfd2() function except that it
+ *   accepts struct file instances instead of file descriptors and it does
  *   not set the errno variable.
  *
  * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
+ *   Zero (OK) is returned on success; a negated errno value is return on
  *   any failure.
  *
  ****************************************************************************/
 
-int file_dup(FAR struct file *filep, int minfd);
+int file_dup2(FAR struct file *filep1, FAR struct file *filep2);
 
 /****************************************************************************
  * Name: fs_dupfd2 OR dup2
@@ -822,6 +822,48 @@ int fs_dupfd2(int fd1, int fd2);
 int file_open(FAR struct file *filep, FAR const char *path, int oflags, ...);
 
 /****************************************************************************
+ * Name: nx_open and nx_vopen
+ *
+ * Description:
+ *   nx_open() is similar to the standard 'open' interface except that is is
+ *   not a cancellation point and it does not modify the errno variable.
+ *
+ *   nx_vopen() is identical except that it accepts a va_list as an argument
+ *   versus taking a variable length list of arguments.
+ *
+ *   nx_open() and nx_vopen are internal NuttX interface and should not be
+ *   called from applications.
+ *
+ * Returned Value:
+ *   The new file descriptor is returned on success; a negated errno value is
+ *   returned on any failure.
+ *
+ ****************************************************************************/
+
+int nx_vopen(FAR const char *path, int oflags, va_list ap);
+int nx_open(FAR const char *path, int oflags, ...);
+
+/****************************************************************************
+ * Name: fs_getfilep
+ *
+ * Description:
+ *   Given a file descriptor, return the corresponding instance of struct
+ *   file.  NOTE that this function will currently fail if it is provided
+ *   with a socket descriptor.
+ *
+ * Input Parameters:
+ *   fd    - The file descriptor
+ *   filep - The location to return the struct file instance
+ *
+ * Returned Value:
+ *   Zero (OK) is returned on success; a negated errno value is returned on
+ *   any failure.
+ *
+ ****************************************************************************/
+
+int fs_getfilep(int fd, FAR struct file **filep);
+
+/****************************************************************************
  * Name: file_detach
  *
  * Description:
@@ -931,39 +973,6 @@ int open_blockdriver(FAR const char *pathname, int mountflags,
 int close_blockdriver(FAR struct inode *inode);
 
 /****************************************************************************
- * Name: fs_ioctl
- *
- * Description:
- *   Perform device specific operations.
- *
- * Input Parameters:
- *   fd       File/socket descriptor of device
- *   req      The ioctl command
- *   arg      The argument of the ioctl cmd
- *
- * Returned Value:
- *   >=0 on success (positive non-zero values are cmd-specific)
- *   -1 on failure with errno set properly:
- *
- *   EBADF
- *     'fd' is not a valid descriptor.
- *   EFAULT
- *     'arg' references an inaccessible memory area.
- *   EINVAL
- *     'cmd' or 'arg' is not valid.
- *   ENOTTY
- *     'fd' is not associated with a character special device.
- *   ENOTTY
- *      The specified request does not apply to the kind of object that the
- *      descriptor 'fd' references.
- *
- ****************************************************************************/
-
-#ifdef CONFIG_LIBC_IOCTL_VARIADIC
-int fs_ioctl(int fd, int req, unsigned long arg);
-#endif
-
-/****************************************************************************
  * Name: fs_fdopen
  *
  * Description:
@@ -1003,48 +1012,6 @@ ssize_t lib_sendfile(int outfd, int infd, off_t *offset, size_t count);
 #endif
 
 /****************************************************************************
- * Name: fs_getfilep
- *
- * Description:
- *   Given a file descriptor, return the corresponding instance of struct
- *   file.  NOTE that this function will currently fail if it is provided
- *   with a socket descriptor.
- *
- * Input Parameters:
- *   fd    - The file descriptor
- *   filep - The location to return the struct file instance
- *
- * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
- *
- ****************************************************************************/
-
-int fs_getfilep(int fd, FAR struct file **filep);
-
-/****************************************************************************
- * Name: nx_open and nx_vopen
- *
- * Description:
- *   nx_open() is similar to the standard 'open' interface except that is is
- *   not a cancellation point and it does not modify the errno variable.
- *
- *   nx_vopen() is identical except that it accepts a va_list as an argument
- *   versus taking a variable length list of arguments.
- *
- *   nx_open() and nx_vopen are internal NuttX interface and should not be
- *   called from applications.
- *
- * Returned Value:
- *   The new file descriptor is returned on success; a negated errno value is
- *   returned on any failure.
- *
- ****************************************************************************/
-
-int nx_vopen(FAR const char *path, int oflags, va_list ap);
-int nx_open(FAR const char *path, int oflags, ...);
-
-/****************************************************************************
  * Name: file_read
  *
  * Description:
@@ -1270,6 +1237,39 @@ int file_ioctl(FAR struct file *filep, int req, unsigned long arg);
 int nx_ioctl(int fd, int req, unsigned long arg);
 
 /****************************************************************************
+ * Name: fs_ioctl
+ *
+ * Description:
+ *   Perform device specific operations.
+ *
+ * Input Parameters:
+ *   fd       File/socket descriptor of device
+ *   req      The ioctl command
+ *   arg      The argument of the ioctl cmd
+ *
+ * Returned Value:
+ *   >=0 on success (positive non-zero values are cmd-specific)
+ *   -1 on failure with errno set properly:
+ *
+ *   EBADF
+ *     'fd' is not a valid descriptor.
+ *   EFAULT
+ *     'arg' references an inaccessible memory area.
+ *   EINVAL
+ *     'cmd' or 'arg' is not valid.
+ *   ENOTTY
+ *     'fd' is not associated with a character special device.
+ *   ENOTTY
+ *      The specified request does not apply to the kind of object that the
+ *      descriptor 'fd' references.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_LIBC_IOCTL_VARIADIC
+int fs_ioctl(int fd, int req, unsigned long arg);
+#endif
+
+/****************************************************************************
  * Name: file_vfcntl
  *
  * Description:
@@ -1339,7 +1339,7 @@ int nx_fcntl(int fd, int cmd, ...);
  *
  * Description:
  *   Low-level poll operation based on struct file.  This is used both to (1)
- *   support detached file, and also (2) by fdesc_poll() to perform all
+ *   support detached file, and also (2) by fs_poll() to perform all
  *   normal operations on file descriptors.
  *
  * Input Parameters:
@@ -1356,6 +1356,26 @@ int nx_fcntl(int fd, int cmd, ...);
 int file_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup);
 
 /****************************************************************************
+ * Name: fs_poll
+ *
+ * Description:
+ *   The standard poll() operation redirects operations on file descriptors
+ *   to this function.
+ *
+ * Input Parameters:
+ *   fd    - The file descriptor of interest
+ *   fds   - The structure describing the events to be monitored, OR NULL if
+ *           this is a request to stop monitoring events.
+ *   setup - true: Setup up the poll; false: Teardown the poll
+ *
+ * Returned Value:
+ *  0: Success; Negated errno on failure
+ *
+ ****************************************************************************/
+
+int fs_poll(int fd, FAR struct pollfd *fds, bool setup);
+
+/****************************************************************************
  * Name: file_fstat
  *
  * Description:
@@ -1397,26 +1417,6 @@ int file_fstat(FAR struct file *filep, FAR struct stat *buf);
 
 int nx_stat(FAR const char *path, FAR struct stat *buf);
 
-/****************************************************************************
- * Name: fdesc_poll
- *
- * Description:
- *   The standard poll() operation redirects operations on file descriptors
- *   to this function.
- *
- * Input Parameters:
- *   fd    - The file descriptor of interest
- *   fds   - The structure describing the events to be monitored, OR NULL if
- *           this is a request to stop monitoring events.
- *   setup - true: Setup up the poll; false: Teardown the poll
- *
- * Returned Value:
- *  0: Success; Negated errno on failure
- *
- ****************************************************************************/
-
-int fdesc_poll(int fd, FAR struct pollfd *fds, bool setup);
-
 #undef EXTERN
 #if defined(__cplusplus)
 }


Mime
View raw message