fs: Don't guard ftruncate with CONFIG_DISABLE_MOUNTPOINT

since ftruncate depends on file_operations not mountpt_operations

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2023-02-10 15:20:43 +08:00 committed by GUIDINGLI
parent a05f9aaa85
commit 4009cb1970
5 changed files with 3 additions and 12 deletions

View File

@ -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_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_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_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 # 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) ifneq ($(CONFIG_PSEUDOFS_SOFTLINKS),0)
CSRCS += fs_link.c fs_symlink.c fs_readlink.c CSRCS += fs_link.c fs_symlink.c fs_readlink.c
endif endif

View File

@ -34,8 +34,6 @@
#include "inode/inode.h" #include "inode/inode.h"
#ifndef CONFIG_DISABLE_MOUNTPOINT
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@ -192,5 +190,3 @@ errout:
set_errno(-ret); set_errno(-ret);
return ERROR; return ERROR;
} }
#endif /* !CONFIG_DISABLE_MOUNTPOINT */

View File

@ -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); int file_truncate(FAR struct file *filep, off_t length);
#endif
/**************************************************************************** /****************************************************************************
* Name: file_mmap * Name: file_mmap

View File

@ -231,6 +231,7 @@ SYSCALL_LOOKUP(pwrite, 4)
SYSCALL_LOOKUP(dup, 1) SYSCALL_LOOKUP(dup, 1)
SYSCALL_LOOKUP(dup2, 2) SYSCALL_LOOKUP(dup2, 2)
SYSCALL_LOOKUP(fcntl, 3) SYSCALL_LOOKUP(fcntl, 3)
SYSCALL_LOOKUP(ftruncate, 2)
SYSCALL_LOOKUP(lseek, 3) SYSCALL_LOOKUP(lseek, 3)
SYSCALL_LOOKUP(mmap, 6) SYSCALL_LOOKUP(mmap, 6)
SYSCALL_LOOKUP(open, 3) SYSCALL_LOOKUP(open, 3)
@ -273,7 +274,6 @@ SYSCALL_LOOKUP(munmap, 2)
#ifndef CONFIG_DISABLE_MOUNTPOINT #ifndef CONFIG_DISABLE_MOUNTPOINT
SYSCALL_LOOKUP(mount, 5) SYSCALL_LOOKUP(mount, 5)
SYSCALL_LOOKUP(ftruncate, 2)
SYSCALL_LOOKUP(mkdir, 2) SYSCALL_LOOKUP(mkdir, 2)
SYSCALL_LOOKUP(rename, 2) SYSCALL_LOOKUP(rename, 2)
SYSCALL_LOOKUP(rmdir, 1) SYSCALL_LOOKUP(rmdir, 1)

View File

@ -31,7 +31,7 @@
"fstat","sys/stat.h","","int","int","FAR struct stat *" "fstat","sys/stat.h","","int","int","FAR struct stat *"
"fstatfs","sys/statfs.h","","int","int","FAR struct statfs *" "fstatfs","sys/statfs.h","","int","int","FAR struct statfs *"
"fsync","unistd.h","","int","int" "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 *" "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 **" "get_environ_ptr","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","FAR char **"
"getenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","FAR char *","FAR const char *" "getenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","FAR char *","FAR const char *"

Can't render this file because it has a wrong number of fields in line 2.