Jukka Laitinen
6db295481b
fs/mmap/fs_rammap.c: Remove void * arithmetic
...
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-13 23:08:58 +08:00
Jukka Laitinen
3577d2f055
fs/mmap/fs_anonmap.c: Remove void * arithmetic
...
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-13 23:08:58 +08:00
Petro Karashchenko
6c5cb98e7d
fs/mount: fix logging macro in FS automount
...
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-01-13 12:18:36 +08:00
Xiang Xiao
fd0195b0d8
fs/mmap: Suppor the partial unmap for anonymous mapping
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-12 19:11:56 +02:00
Xiang Xiao
fcd4a421e3
fs/mmap: Support the no backing file for anonymous mapping
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-12 19:11:56 +02:00
Xiang Xiao
ab67d6a75b
fs/mmap: Remove the duplication rammap handling
...
and minor ifx for style and format
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-12 19:11:56 +02:00
Ville Juven
416e83d57e
fs/poll: add missing FAR qualifier to poll()
...
Follow-up to #8072
2023-01-11 21:12:17 +08:00
Ville Juven
f730cf8ad8
fs/poll: Fix poll_notify for CONFIG_BUILD_KERNEL
...
With flat addressing the user pollfd list is given directly to the
drivers that perform the notification. This is fine when the addressing
is flat, as there is no ambiguity on who gets notified and the fds memory
is always mapped.
For kernel mode with MMU this does not work. The notification must be done
via a temporary buffer allocated from kernel memory.
Thus, create a copy of the user fds and pass the copy to the drivers.
Afterwards copy the output events back to the user.
2023-01-11 01:53:13 +08:00
Jukka Laitinen
b8f23fc3f7
Move rammaps to use mm_map list
...
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-10 18:34:25 +08:00
Jukka Laitinen
a5ed8014e8
Move anonymous mapping emulation into own module under fs/mmap
...
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-10 18:34:25 +08:00
Jukka Laitinen
dd97900221
fs/mmap: Add mappings to mm_map list if CONFIG_MM_MAP is defined
...
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-10 18:34:25 +08:00
wangbowen6
a491d07061
sem_unlink: return ENOENT when the named semaphore does not exist.
...
Follow posix, return ENOENT when the named semaphore does not
exist to fix the ltp open posix sem_unlink 4-1.c test problem.
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2023-01-09 22:46:30 +08:00
Xiang Xiao
9aa835815f
fs/timerfd: Reverse truncate and mmap field
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-07 14:27:42 +02:00
qinwei1
c137aeec32
fs/vfs: add missed truncate/mmap callback at timerfd file_operation
...
Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2023-01-06 13:31:38 +08:00
Xiang Xiao
1a59f4ed00
mm/map: Remove the unnessary map.h inclusion in various drivers
...
and Fix include/nuttx/mm/map.h:55:28: error: 'struct task_group_s' declared inside parameter list will not be visible outside of this definition or declaration
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-05 16:06:53 +02:00
Xiang Xiao
7179d57026
fs: Check offset and length more carefully in mmap callback
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 17:43:59 +02:00
Xiang Xiao
b0a0ba3ad7
fs: Move mmap callback before truncate in [file|mountpt]_operations
...
since mmap may exist in block_operations, but truncate may not,
moving mmap beforee truncate could make three struct more compatible
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 17:43:59 +02:00
Xiang Xiao
779a610ca3
Remove the unnecessary NULL fields in global instance definition of file_operations
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 00:32:13 +02:00
Jukka Laitinen
f33dc4df3f
Change FIOC_MMAP into file operation call
...
- Add mmap into file_operations and remove it from ioctl definitions.
- Add mm_map structure definitions to support future unmapping
- Modify all drivers to initialize the operations struct accordingly
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-02 11:23:20 -03:00
Jukka Laitinen
41e9df2f3e
Add ftruncate into file operation calls
...
- Add truncate into file_operations
- Move truncate to be common for mountpt_operations and file_operations
- Modify all drivers to initialize the operations struct accordingly
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-02 11:23:20 -03:00
Jukka Laitinen
36528eed64
Revert "fs/vfs/fs_truncate.c: Use ioctl to truncate on non-mountpoint inode"
...
This reverts commit dbc163f1b0
.
2023-01-02 11:23:20 -03:00
dongjiuzhu1
f85d9a9332
fs/signalfd: using file descriptor to accept signal
...
Reference here:
https://man7.org/linux/man-pages/man2/signalfd.2.html
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-12-28 23:05:58 +08:00
dongjiuzhu1
d36b7fea45
timerfd: remove timeout work and do notify in isr
...
1.Optimize notification speed
2.using enter/leave critical to replace spin_lock to avoid race condition
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-12-28 22:45:25 +08:00
dongjiuzhu1
c7eca3d176
timerfd/eventfd: using file_allocate to replace register_driver
...
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-12-28 22:45:25 +08:00
Xiang Xiao
72e76600c3
fs/procfs: Avoid the cast in uptime_read
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-24 11:26:48 -03:00
Ville Juven
2ed51d026c
fs/streams: Move the file streams from the group structure into TLS
...
This is preparation for flushing streams from user space, like it should
be done.
- Move tg_streamlist (group, kernel space) ->
ta_streamlist (TLS, user space)
- Access stream list via tg_info in kernel
- Access stream list via TLS in user space
- Remove / rename nxsched_get_streams -> lib_getstreams
- Remove system call for nxsched_get_streams
2022-12-22 20:16:11 +08:00
Xiang Xiao
fd0d6a9bf5
compiler.h: Add _ between format|printf|syslog|scanf|strftime and like
...
align with other macro naming style
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-21 01:05:19 +02:00
anjiahao
70791af8e2
procmeminfo:support memdump can show specific task
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-12-19 20:43:33 +08:00
zhangyuan21
3462061624
task: show thread main entry when display thread name
...
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2022-12-17 14:53:59 +08:00
qinwei1
a4f06660d2
fs_epoll: fix some potential issue for list operation
...
VELAPLATFO-4690
Summary
1. delete item before free it
Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
Change-Id: Ie101a0cdba97caa8c3bbf0830dc0a35750688a41
2022-12-13 21:00:11 +02:00
chao an
b5507ea9a2
compile/attribute: minor fix for packed struct mismatch
...
Signed-off-by: chao an <anchao@xiaomi.com>
2022-12-06 03:50:20 +08:00
crafcat7
8b95b7ca5b
littlefs: Get and return the current error status before RMDIR execution type
...
In some cases, deleting a folder will return unexpected results. For example, ENOENT should be returned when deleting a non-existent folder, but the result will return ENOTDIR.
2022-12-03 02:44:49 +08:00
YAMAMOTO Takashi
8ee2ed0b91
littlefs: add a few Kconfig options
2022-12-01 23:34:31 +08:00
dongjiuzhu1
b1b2a7cc0b
timerfd_create: initial reference count to zero
...
nx_open in timerfd_create will increase reference count,
Therefore, the reference count starts with a value of 0.
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-12-01 15:07:09 +08:00
Gao Feng
08f5a5a3be
meminfo: buflen identify the left of buffer
...
It is enought to only checking the buflen's avaiable or not.
(total size means total copied size)
Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-11-29 01:29:55 +08:00
ligd
11fa70d53a
romfs: change lock to recursion lock
...
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-11-28 18:04:38 +08:00
wangbowen6
a0ded9d0d4
fs_epoll: [bug fix] epoll node use-after-free in epoll extend list
...
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-11-26 11:56:58 +08:00
wangbowen6
2f2176151e
fs_epoll: [bug fix] EPOLL_CTL_ADD/MOD consider the teardown list too
...
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-11-25 21:34:09 +08:00
wangbowen6
25bfd437fe
fs_epoll: support extend the epoll dynamicly.
...
1. epoll_ctl(EPOLL_CTL_ADD) support extend the epoll
events dynamicly;
2. enhance the epoll performance by moving some poll setup
and teardown process to the EPOLL_CTL_ADD/DEL/MOD;
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-11-22 21:08:56 +08:00
chao an
3727de1a93
fs/userfs: destroy nxmutex properly
...
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-21 01:15:48 +08:00
qinwei1
8021dfece6
sched/task/task_getpid: getpid should return process id not thread id
...
Summary:
implement the right semantics:
1. getpid should return the main thread id
2. gettid should return the current thread id
Refer to:
https://github.com/apache/incubator-nuttx/issues/2499
https://github.com/apache/incubator-nuttx/pull/2518
Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2022-11-17 17:58:08 +08:00
zhangyuan21
f27065cb9e
sched/mqueue: make mqueue and mqueue sysv can disable separately
2022-11-16 20:03:40 +08:00
dongjiuzhu1
0740ebb21b
fs/unionfs: fix memory leak about directory operation
...
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-11-14 14:31:02 +08:00
Marco Casaroli
36c511f710
fs/littlefs: set LFS_NAME_MAX
to CONFIG_NAME_MAX
2022-11-13 09:12:54 +08:00
Xiang Xiao
6f33dd6ea0
mm/heap: Change TCB_FLAG_HEAPCHECK to TCB_FLAG_HEAP_CHECK
...
align with other flags naming convention
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-12 09:39:01 +01:00
Xiang Xiao
b72be1ddbf
epoll: Call poll_notify before unlock mutex
...
to avoid the race condition
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-11 21:12:59 +01:00
Xiang Xiao
7e8e5c10d1
fs/epoll: Reuse fd returned from epoll for internal signaling
...
to avoid the usage of nuttx special extension(POLLFILE)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-11 21:12:59 +01:00
Xiang Xiao
faf16fb810
vfs/epoll: Protect epoll_ctl by mutex
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-08 22:06:46 +01:00
Xiang Xiao
7231a5f044
vfs/epoll: Replace sem_t with mutex_t for locking usage
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-08 22:06:46 +01:00
Xiang Xiao
38d1244751
mm/mempool: Remove MM_MEMPOOL option from Kconfig
...
since the linker can remove the unused object file from the final image
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-08 10:18:27 -03:00