Commit Graph

1631 Commits

Author SHA1 Message Date
Jiuzhu Dong
02ba5f4103 fs/epoll_fd: support dup file descriptor
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-02-11 13:52:35 +08:00
Jiuzhu Dong
bff02fcd79 romfs: add FAR for all pointer and optimize some code
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-02-11 13:46:05 +08:00
chao.an
99cde13a11 net/inet: move socket flags into socket_conn_s
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-02-10 15:04:33 -03:00
Xiang Xiao
e7953d8d9c semaphore: Change FS_NAMED_SEMPATH from "/var/lock" to "/var/sem"
since sem isn't only used as lock

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-05 23:58:01 +01:00
Xiang Xiao
c6beb35e9e semaphore: Rename FS_NAMED_SEMPATH to FS_NAMED_SEMAPHORES_VFS_PATH
align with other similiar config which suffix with _VFS_PATH

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-05 23:58:01 +01:00
Xiang Xiao
938a995c92 mqueue: Rename FS_MQUEUE_MPATH to FS_MQUEUE_VFS_PATH
align with other similiar config which suffix with _VFS_PATH

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-05 23:58:01 +01:00
Xiang Xiao
ea4a276eb0 shm: Rename FS_SHMPATH to FS_SHM_VFS_PATH
align with other similiar config which suffix with _VFS_PATH

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-05 23:58:01 +01:00
Xiang Xiao
0eec2f5251 fs: Remove the unnecessary Kconfig definition
since all these options should always have the default value

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-05 23:58:01 +01:00
Petro Karashchenko
76a9af90c3 fs_automount: add options for signaling when volume is mounted and unmounted
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-02-04 03:27:16 +08:00
Xiang Xiao
5c5f1dec08 sched: Don't duplicate caller file handler when creating kernel thread
kernel thread should have only the starndard file i/o just like idle thread

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-01 08:22:45 +09:00
Xiang Xiao
a24ae559c2 arch: Decouple up_critmon_[gettime|convert] from critmon
and rename to up_perf_[gettime|convert] since it's useful in other case

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-25 14:43:34 +08:00
Xiang Xiao
77792a1598 sched: Define CONFIG_SMP_NCPUS to 1 in no SMP case
to simplify the SMP related code logic

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-20 23:21:21 +08:00
Jukka Laitinen
ae31cbde09 Fix an overflow in blkcnt_t gpt_last_lba
If CONFIG_FS_LARGEFILE is not defined, the calculation overflows for larger
disks, since blkcnt_t is 32 bits.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-01-19 15:58:35 +01:00
Petro Karashchenko
9551de7115 net: use HTONS, NTOHS, HTONL, NTOHL macro in kernel code
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-18 10:59:47 +01:00
SPRESENSE
8d591d5bc7 fs/smartfs: Fix file size corruption when opening with truncate mode
If a existing file is opened with truncate mode e.g. fopen(file, "w+"),
the file size will be incorrect after writing any data to the file.
Before writing to the first sector, the reading is performed again.
As a result, it makes an invalid file size. When a sector buffer is used,
it must also write to the first sector.
2022-01-18 08:44:49 +01:00
SPRESENSE
60913d3b69 Revert "fs/smartfs: Fix file size corruption when opening with overwriting mode"
This reverts commit 89a79b03cf.
2022-01-18 08:44:49 +01:00
Petro Karashchenko
8d3bf05fd2 include: fix double include pre-processor guards
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-16 11:11:14 -03:00
YAMAMOTO Takashi
39ab0f4836 Do not require write-access for fsync
* fsync doesn't modify the file. It doesn't make sense to require
  write-access.

* This matches what ~all other systems do.
  At least Linux, macOS, and NetBSD.
2022-01-14 09:01:08 +01:00
Jukka Laitinen
8167dd6b06 fs/partition/fs_gpt.c: Fix compilation errors when CONFIG_FS_LARGEFILE is not defined
This fixes some number formatting errors for 64-bit targets
- GPT_HEADER_SIGNATURE is defined as "unsigned long long", so just print it as it is (without PRI macro)
- The size of blkcnt_t depends on CONFIG_FS_LARGEFILE and CONFIG_HAVE_LONG_LONG

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-01-13 17:46:29 +08:00
Xiang Xiao
1b77ae88ef fs/procfs: Remove the unnecessary strcmp
since the procfs already make the same check for us

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-12 07:19:40 +01:00
Petro Karashchenko
a743fed63d file_operations: get back C89 compatible initializer
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-11 02:14:00 +08:00
Jiuzhu Dong
f93c17be94 fs/procfs: fix readdir loss last character
nsh> ls
/proc:
 0/
 1/
 2/
 3/
 4/
 5/
 meminf
 iobinf
 f/
 ne/
 sel/
 uptim
 versio

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-01-05 21:58:38 +08:00
Jiuzhu Dong
c6bd160be5 fs/romfs: remove the error single list and using reference
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-01-05 12:22:17 +08:00
Jiuzhu Dong
06f76747fc fs/romfs: fix the typo error
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-01-05 12:22:17 +08:00
zhouliang3
1f53a058fa nuttx:Change fs strncpy to strlcpy to avoid losing'\0'
Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
2021-12-30 18:06:00 +08:00
Petro Karashchenko
3ccb657dc2 nuttx: remove space befone newline in logs
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2021-12-27 21:01:19 -06:00
Petro Karashchenko
d445282566 fs/vfs: Add file descriptor based timers support
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2021-12-20 04:00:20 -06:00
Xiang Xiao
0896d0680b eventfd: Change mode_semaphore from uint8_t to bool
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-19 01:41:11 -06:00
Xiang Xiao
76a4ca01a3 eventfd: Change minor type from size_t to unsigned int
to avoid the potential overflow devpath buffer on 64bit platform

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-19 01:41:11 -06:00
Xiang Xiao
8cb24a2964 eventfd: Fix the typo error
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-19 01:41:11 -06:00
Xiang Xiao
f9c1117c88 eventfd: Remove the unused and private eventfd_get_minor
since it isn't defined by Linux kernel too

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-19 01:41:11 -06:00
Jiuzhu Dong
f04ca25f9d tmpfs: support fsync always successful
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-12-17 13:27:21 -03:00
ligd
5b369c5cec libs/lbc: remove CHAR_BIT = 16 support
For CEVA platform CHAR_BIT is 16, and will do lots of extra work
when use IPC.
We will not support this platform anymore, so remove all the b2c operations.

Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-12-13 11:08:28 -06:00
ligd
b294303e41 hostfs: add lock to hostfs_rewinddir
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-12-13 02:00:47 -06:00
Xiang Xiao
1af8cd4de8 sched: Move argv from tcb_s to task_info_s
argv is allocated from stack and then belong to userspace,
so task_info_s is a best location to hold this information.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-11 10:08:53 -06:00
Masayuki Ishikawa
a8d446851c fs: fat: Use uint16_t instead of wchar_t
Summary:
- Due to the recent changes of wchar_t, ls command always
  causes errors for the fat file system.
- This commit fixes this issue by replacing wchar_t with
  uint16_t under fs/fat

Impact:
- None

Testing:
- Tested with spresense:wifi and stm32f4discovery:wifi

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-12-09 21:29:29 -06:00
ligd
985cc4fc6d hosfs_rpmsg: merge hostfs_rpmsg to rpmsgfs
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-12-04 01:04:18 -06:00
Xiang Xiao
d2b693a204 sched: Move g_tcbinfo to include/nuttx/sched.h
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-11-22 14:59:48 -03:00
ligd
87c47b8758 procfs: fix ps can't log out Group id
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-11-11 11:13:12 -03:00
zhuyanlin
e53aeea60e fs:procfs: add tcbinfo procfs interface
Add tcbinfo in procfs system.

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-11-10 14:31:10 -03:00
Jiuzhu Dong
e5f8acab97 ftruncate: sanity check for parameter:length
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-11-01 11:08:03 +01:00
Xiang Xiao
5f7cc04627 fs/aio: Fix compile warning
aio/lio_listio.c:227:7: warning: implicit declaration of function ‘ferr’ [-Wimplicit-function-declaration]
  227 |       ferr("ERROR: lib_zalloc failed\n");
      |       ^~~~
aio/lio_listio.c:275:3: warning: implicit declaration of function ‘finfo’ [-Wimplicit-function-declaration]
  275 |   finfo("Registering signal handler\n");

aio/aio_read.c: In function ‘aio_read_worker’:
aio/aio_read.c:90:11: warning: implicit declaration of function ‘file_pread’; did you mean ‘aio_read’? [-Wimplicit-function-declaration]
   90 |   nread = file_pread(aioc->aioc_filep, (FAR void *)aiocbp->aio_buf,
      |           ^~~~~~~~~~
      |           aio_read

aio/aio_write.c: In function ‘aio_write_worker’:
aio/aio_write.c:85:12: warning: implicit declaration of function ‘file_fcntl’ [-Wimplicit-function-declaration]
   85 |   oflags = file_fcntl(aioc->aioc_filep, F_GETFL);
      |            ^~~~~~~~~~
CC:  mmap/fs_mmap.c
CC:  pthread/pthread_condclockwait.c
aio/aio_write.c:107:18: warning: implicit declaration of function ‘file_write’; did you mean ‘aio_write’? [-Wimplicit-function-declaration]
  107 |       nwritten = file_write(aioc->aioc_filep,
      |                  ^~~~~~~~~~
      |                  aio_write
aio/aio_write.c:113:18: warning: implicit declaration of function ‘file_pwrite’; did you mean ‘aio_write’? [-Wimplicit-function-declaration]
  113 |       nwritten = file_pwrite(aioc->aioc_filep,
      |                  ^~~~~~~~~~~
      |                  aio_write
In file included from aio/aio_write.c:34:
aio/aio_write.c:121:12: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘ssize_t’ {aka ‘long int’} [-Wformat=]
  121 |       ferr("ERROR: write/pwrite/send failed: %d\n", nwritten);
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~
      |                                                     |
      |                                                     ssize_t {aka long int}
aio/aio_write.c:121:47: note: format string is defined here
  121 |       ferr("ERROR: write/pwrite/send failed: %d\n", nwritten);
      |                                              ~^
      |                                               |
      |                                               int
      |                                              %ld

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-10-31 06:30:57 -03:00
Jiuzhu Dong
b5b00c6ba3 fs/partition: support parse gpt partition
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-10-30 01:24:09 -05:00
Jiuzhu Dong
aaf1a5e113 fs/partition: support parse mbr partition
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-10-30 01:24:09 -05:00
ligd
e3d20d2c54 mqueue: fix memory leak cause by lost inode_release
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-10-25 18:57:43 +09:00
Masayuki Ishikawa
585b1fc113 fs: mqueue: Change MAX_MQUEUE_PATH to 64
Summary:
- This commit changes MAX_MQUEUE_PATH to 64 to reduce stack
  memory if the NAME_MAX is large

Impact:
- None

Testing:
- Tested with spresense:rndis_smp

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-10-25 03:57:09 -05:00
Gustavo Henrique Nihei
3819d93b4e fs/mount: Properly handle missing FS on the supported list
Instead of reporting the failure to find a given FS, nx_mount was
reporting a failure to find the block driver, even when the actual block
driver exists.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-10-23 04:02:22 -05:00
Gustavo Henrique Nihei
c019533d7a fs/driver: Fix missing declaration of find_mtddriver when CONFIG_MTD=n
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-10-23 04:02:22 -05:00
anjiahao
0aa14f832d mq_open: add long file name check and parameter check
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2021-10-21 11:01:45 -03:00
Xiang Xiao
970cbff638 fs/partition: Make parse_ptable_partition to partition.h
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-10-19 08:03:12 -03:00