You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by li...@apache.org on 2023/02/14 03:24:43 UTC

[nuttx] branch master updated (bd7e521871 -> a3a1883787)

This is an automated email from the ASF dual-hosted git repository.

ligd pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


    from bd7e521871 net/sendfile: adapt sendfile() to support new driver model
     new a05f9aaa85 fs: Don't guard fsync with CONFIG_DISABLE_MOUNTPOINT
     new 4009cb1970 fs: Don't guard ftruncate with CONFIG_DISABLE_MOUNTPOINT
     new a3a1883787 fs: Don't guard rename with CONFIG_DISABLE_MOUNTPOINT

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 fs/inode/fs_files.c          | 8 --------
 fs/vfs/Make.defs             | 7 ++-----
 fs/vfs/fs_fsync.c            | 9 ++++-----
 fs/vfs/fs_truncate.c         | 4 ----
 include/nuttx/fs/fs.h        | 4 ----
 include/sys/syscall_lookup.h | 8 ++++----
 syscall/syscall.csv          | 8 ++++----
 7 files changed, 14 insertions(+), 34 deletions(-)


[nuttx] 01/03: fs: Don't guard fsync with CONFIG_DISABLE_MOUNTPOINT

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit a05f9aaa852ba5ab05f851c7aedcd29a63695741
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Fri Feb 10 14:54:23 2023 +0800

    fs: Don't guard fsync with CONFIG_DISABLE_MOUNTPOINT
    
    since the driver can also support fsync by implementing BIOC_FLUSH
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 fs/inode/fs_files.c          | 8 --------
 fs/vfs/Make.defs             | 4 ++--
 fs/vfs/fs_fsync.c            | 9 ++++-----
 include/nuttx/fs/fs.h        | 2 --
 include/sys/syscall_lookup.h | 4 ++--
 syscall/syscall.csv          | 4 ++--
 6 files changed, 10 insertions(+), 21 deletions(-)

diff --git a/fs/inode/fs_files.c b/fs/inode/fs_files.c
index ad6e2e893b..e38662b777 100644
--- a/fs/inode/fs_files.c
+++ b/fs/inode/fs_files.c
@@ -98,8 +98,6 @@ static int files_extend(FAR struct filelist *list, size_t row)
   return 0;
 }
 
-#ifndef CONFIG_DISABLE_MOUNTPOINT
-
 static void task_fssync(FAR struct tcb_s *tcb, FAR void *arg)
 {
   FAR struct filelist *list;
@@ -129,8 +127,6 @@ static void task_fssync(FAR struct tcb_s *tcb, FAR void *arg)
   nxmutex_unlock(&list->fl_lock);
 }
 
-#endif /* !CONFIG_DISABLE_MOUNTPOINT */
-
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
@@ -638,8 +634,6 @@ int close(int fd)
   return ret;
 }
 
-#ifndef CONFIG_DISABLE_MOUNTPOINT
-
 /****************************************************************************
  * Name: sync
  *
@@ -653,5 +647,3 @@ void sync(void)
 {
   nxsched_foreach(task_fssync, NULL);
 }
-
-#endif /* !CONFIG_DISABLE_MOUNTPOINT */
diff --git a/fs/vfs/Make.defs b/fs/vfs/Make.defs
index 5727636820..6a9ed945ad 100644
--- a/fs/vfs/Make.defs
+++ b/fs/vfs/Make.defs
@@ -24,12 +24,12 @@ CSRCS += fs_chstat.c fs_close.c fs_dup.c fs_dup2.c fs_fcntl.c fs_epoll.c
 CSRCS += fs_fchstat.c fs_fstat.c fs_fstatfs.c fs_ioctl.c fs_lseek.c
 CSRCS += fs_mkdir.c fs_open.c fs_poll.c fs_pread.c fs_pwrite.c fs_read.c
 CSRCS += fs_rename.c fs_rmdir.c fs_select.c fs_sendfile.c fs_stat.c
-CSRCS += fs_statfs.c fs_unlink.c fs_write.c fs_dir.c
+CSRCS += fs_statfs.c fs_unlink.c fs_write.c fs_dir.c fs_fsync.c
 
 # Certain interfaces are not available if there is no mountpoint support
 
 ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y)
-CSRCS += fs_fsync.c fs_truncate.c
+CSRCS += fs_truncate.c
 endif
 
 ifneq ($(CONFIG_PSEUDOFS_SOFTLINKS),0)
diff --git a/fs/vfs/fs_fsync.c b/fs/vfs/fs_fsync.c
index c36667a808..21c361851d 100644
--- a/fs/vfs/fs_fsync.c
+++ b/fs/vfs/fs_fsync.c
@@ -36,8 +36,6 @@
 
 #include "inode/inode.h"
 
-#ifndef CONFIG_DISABLE_MOUNTPOINT
-
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
@@ -65,6 +63,7 @@ int file_fsync(FAR struct file *filep)
   inode = filep->f_inode;
   if (inode != NULL)
     {
+#ifndef CONFIG_DISABLE_MOUNTPOINT
       if (INODE_IS_MOUNTPT(inode) && inode->u.i_mops &&
           inode->u.i_mops->sync)
         {
@@ -72,7 +71,9 @@ int file_fsync(FAR struct file *filep)
 
           return inode->u.i_mops->sync(filep);
         }
-      else if (inode->u.i_ops && inode->u.i_ops->ioctl)
+      else
+#endif
+      if (inode->u.i_ops && inode->u.i_ops->ioctl)
         {
           ret = inode->u.i_ops->ioctl(filep, BIOC_FLUSH, 0);
           return ret >= 0 ? 0 : ret;
@@ -125,5 +126,3 @@ errout:
   set_errno(-ret);
   return ERROR;
 }
-
-#endif /* !CONFIG_DISABLE_MOUNTPOINT */
diff --git a/include/nuttx/fs/fs.h b/include/nuttx/fs/fs.h
index 4bd0357e67..69a296800b 100644
--- a/include/nuttx/fs/fs.h
+++ b/include/nuttx/fs/fs.h
@@ -1241,9 +1241,7 @@ off_t nx_seek(int fd, off_t offset, int whence);
  *
  ****************************************************************************/
 
-#ifndef CONFIG_DISABLE_MOUNTPOINT
 int file_fsync(FAR struct file *filep);
-#endif
 
 /****************************************************************************
  * Name: file_truncate
diff --git a/include/sys/syscall_lookup.h b/include/sys/syscall_lookup.h
index a159cad3ff..506d15eafd 100644
--- a/include/sys/syscall_lookup.h
+++ b/include/sys/syscall_lookup.h
@@ -240,6 +240,8 @@ SYSCALL_LOOKUP(fstat,                      2)
 SYSCALL_LOOKUP(statfs,                     2)
 SYSCALL_LOOKUP(fstatfs,                    2)
 SYSCALL_LOOKUP(sendfile,                   4)
+SYSCALL_LOOKUP(sync,                       0)
+SYSCALL_LOOKUP(fsync,                      1)
 SYSCALL_LOOKUP(chmod,                      2)
 SYSCALL_LOOKUP(lchmod,                     2)
 SYSCALL_LOOKUP(fchmod,                     2)
@@ -271,8 +273,6 @@ SYSCALL_LOOKUP(munmap,                     2)
 
 #ifndef CONFIG_DISABLE_MOUNTPOINT
   SYSCALL_LOOKUP(mount,                    5)
-  SYSCALL_LOOKUP(sync,                     0)
-  SYSCALL_LOOKUP(fsync,                    1)
   SYSCALL_LOOKUP(ftruncate,                2)
   SYSCALL_LOOKUP(mkdir,                    2)
   SYSCALL_LOOKUP(rename,                   2)
diff --git a/syscall/syscall.csv b/syscall/syscall.csv
index ac2706ac36..f5a8f3220b 100644
--- a/syscall/syscall.csv
+++ b/syscall/syscall.csv
@@ -30,7 +30,7 @@
 "fs_fdopen","nuttx/fs/fs.h","defined(CONFIG_FILE_STREAM)","int","int","int","FAR struct tcb_s *","FAR struct file_struct **"
 "fstat","sys/stat.h","","int","int","FAR struct stat *"
 "fstatfs","sys/statfs.h","","int","int","FAR struct statfs *"
-"fsync","unistd.h","!defined(CONFIG_DISABLE_MOUNTPOINT)","int","int"
+"fsync","unistd.h","","int","int"
 "ftruncate","unistd.h","!defined(CONFIG_DISABLE_MOUNTPOINT)","int","int","off_t"
 "futimens","sys/stat.h","","int","int","const struct timespec [2]|FAR const struct timespec *"
 "get_environ_ptr","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","FAR char **"
@@ -166,7 +166,7 @@
 "stat","sys/stat.h","","int","FAR const char *","FAR struct stat *"
 "statfs","sys/statfs.h","","int","FAR const char *","FAR struct statfs *"
 "symlink","unistd.h","defined(CONFIG_PSEUDOFS_SOFTLINKS)","int","FAR const char *","FAR const char *"
-"sync","unistd.h","!defined(CONFIG_DISABLE_MOUNTPOINT)","void"
+"sync","unistd.h","","void"
 "sysinfo","sys/sysinfo.h","","int","FAR struct sysinfo *"
 "task_create","sched.h","!defined(CONFIG_BUILD_KERNEL)", "int","FAR const char *","int","int","main_t","FAR char * const []|FAR char * const *"
 "task_delete","sched.h","!defined(CONFIG_BUILD_KERNEL)","int","pid_t"


[nuttx] 03/03: fs: Don't guard rename with CONFIG_DISABLE_MOUNTPOINT

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit a3a1883787a873577c96c6dd1723b139f46f5e52
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Fri Feb 10 15:27:38 2023 +0800

    fs: Don't guard rename with CONFIG_DISABLE_MOUNTPOINT
    
    since the pseudo root fs support rename too
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 include/sys/syscall_lookup.h | 2 +-
 syscall/syscall.csv          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/sys/syscall_lookup.h b/include/sys/syscall_lookup.h
index 8dc62e9438..69446104d6 100644
--- a/include/sys/syscall_lookup.h
+++ b/include/sys/syscall_lookup.h
@@ -235,6 +235,7 @@ SYSCALL_LOOKUP(ftruncate,                  2)
 SYSCALL_LOOKUP(lseek,                      3)
 SYSCALL_LOOKUP(mmap,                       6)
 SYSCALL_LOOKUP(open,                       3)
+SYSCALL_LOOKUP(rename,                     2)
 SYSCALL_LOOKUP(stat,                       2)
 SYSCALL_LOOKUP(lstat,                      2)
 SYSCALL_LOOKUP(fstat,                      2)
@@ -275,7 +276,6 @@ SYSCALL_LOOKUP(munmap,                     2)
 #ifndef CONFIG_DISABLE_MOUNTPOINT
   SYSCALL_LOOKUP(mount,                    5)
   SYSCALL_LOOKUP(mkdir,                    2)
-  SYSCALL_LOOKUP(rename,                   2)
   SYSCALL_LOOKUP(rmdir,                    1)
   SYSCALL_LOOKUP(umount2,                  2)
   SYSCALL_LOOKUP(unlink,                   1)
diff --git a/syscall/syscall.csv b/syscall/syscall.csv
index f6215bf715..5759e61901 100644
--- a/syscall/syscall.csv
+++ b/syscall/syscall.csv
@@ -110,7 +110,7 @@
 "recv","sys/socket.h","defined(CONFIG_NET)","ssize_t","int","FAR void *","size_t","int"
 "recvfrom","sys/socket.h","defined(CONFIG_NET)","ssize_t","int","FAR void*","size_t","int","FAR struct sockaddr*","FAR socklen_t*"
 "recvmsg","sys/socket.h","defined(CONFIG_NET)","ssize_t","int","FAR struct msghdr *","int"
-"rename","stdio.h","!defined(CONFIG_DISABLE_MOUNTPOINT)","int","FAR const char *","FAR const char *"
+"rename","stdio.h","","int","FAR const char *","FAR const char *"
 "rmdir","unistd.h","!defined(CONFIG_DISABLE_MOUNTPOINT)","int","FAR const char*"
 "rmmod","nuttx/module.h","defined(CONFIG_MODULE)","int","FAR void *"
 "sched_getaffinity","sched.h","defined(CONFIG_SMP)","int","pid_t","size_t","FAR cpu_set_t *"


[nuttx] 02/03: fs: Don't guard ftruncate with CONFIG_DISABLE_MOUNTPOINT

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 4009cb1970c05f932b161d5fc253e8f67f1a5650
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Fri Feb 10 15:20:43 2023 +0800

    fs: Don't guard ftruncate with CONFIG_DISABLE_MOUNTPOINT
    
    since ftruncate depends on file_operations not mountpt_operations
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 fs/vfs/Make.defs             | 5 +----
 fs/vfs/fs_truncate.c         | 4 ----
 include/nuttx/fs/fs.h        | 2 --
 include/sys/syscall_lookup.h | 2 +-
 syscall/syscall.csv          | 2 +-
 5 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/fs/vfs/Make.defs b/fs/vfs/Make.defs
index 6a9ed945ad..92bf939c98 100644
--- a/fs/vfs/Make.defs
+++ b/fs/vfs/Make.defs
@@ -25,13 +25,10 @@ CSRCS += fs_fchstat.c fs_fstat.c fs_fstatfs.c fs_ioctl.c fs_lseek.c
 CSRCS += fs_mkdir.c fs_open.c fs_poll.c fs_pread.c fs_pwrite.c fs_read.c
 CSRCS += fs_rename.c fs_rmdir.c fs_select.c fs_sendfile.c fs_stat.c
 CSRCS += fs_statfs.c fs_unlink.c fs_write.c fs_dir.c fs_fsync.c
+CSRCS += fs_truncate.c
 
 # Certain interfaces are not available if there is no mountpoint support
 
-ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y)
-CSRCS += fs_truncate.c
-endif
-
 ifneq ($(CONFIG_PSEUDOFS_SOFTLINKS),0)
 CSRCS += fs_link.c fs_symlink.c fs_readlink.c
 endif
diff --git a/fs/vfs/fs_truncate.c b/fs/vfs/fs_truncate.c
index c4c0297640..91bbd8e5a0 100644
--- a/fs/vfs/fs_truncate.c
+++ b/fs/vfs/fs_truncate.c
@@ -34,8 +34,6 @@
 
 #include "inode/inode.h"
 
-#ifndef CONFIG_DISABLE_MOUNTPOINT
-
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
@@ -192,5 +190,3 @@ errout:
   set_errno(-ret);
   return ERROR;
 }
-
-#endif /* !CONFIG_DISABLE_MOUNTPOINT */
diff --git a/include/nuttx/fs/fs.h b/include/nuttx/fs/fs.h
index 69a296800b..5d36568066 100644
--- a/include/nuttx/fs/fs.h
+++ b/include/nuttx/fs/fs.h
@@ -1253,9 +1253,7 @@ int file_fsync(FAR struct file *filep);
  *
  ****************************************************************************/
 
-#ifndef CONFIG_DISABLE_MOUNTPOINT
 int file_truncate(FAR struct file *filep, off_t length);
-#endif
 
 /****************************************************************************
  * Name: file_mmap
diff --git a/include/sys/syscall_lookup.h b/include/sys/syscall_lookup.h
index 506d15eafd..8dc62e9438 100644
--- a/include/sys/syscall_lookup.h
+++ b/include/sys/syscall_lookup.h
@@ -231,6 +231,7 @@ SYSCALL_LOOKUP(pwrite,                     4)
 SYSCALL_LOOKUP(dup,                        1)
 SYSCALL_LOOKUP(dup2,                       2)
 SYSCALL_LOOKUP(fcntl,                      3)
+SYSCALL_LOOKUP(ftruncate,                  2)
 SYSCALL_LOOKUP(lseek,                      3)
 SYSCALL_LOOKUP(mmap,                       6)
 SYSCALL_LOOKUP(open,                       3)
@@ -273,7 +274,6 @@ SYSCALL_LOOKUP(munmap,                     2)
 
 #ifndef CONFIG_DISABLE_MOUNTPOINT
   SYSCALL_LOOKUP(mount,                    5)
-  SYSCALL_LOOKUP(ftruncate,                2)
   SYSCALL_LOOKUP(mkdir,                    2)
   SYSCALL_LOOKUP(rename,                   2)
   SYSCALL_LOOKUP(rmdir,                    1)
diff --git a/syscall/syscall.csv b/syscall/syscall.csv
index f5a8f3220b..f6215bf715 100644
--- a/syscall/syscall.csv
+++ b/syscall/syscall.csv
@@ -31,7 +31,7 @@
 "fstat","sys/stat.h","","int","int","FAR struct stat *"
 "fstatfs","sys/statfs.h","","int","int","FAR struct statfs *"
 "fsync","unistd.h","","int","int"
-"ftruncate","unistd.h","!defined(CONFIG_DISABLE_MOUNTPOINT)","int","int","off_t"
+"ftruncate","unistd.h","","int","int","off_t"
 "futimens","sys/stat.h","","int","int","const struct timespec [2]|FAR const struct timespec *"
 "get_environ_ptr","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","FAR char **"
 "getenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","FAR char *","FAR const char *"