Commit Graph

2298 Commits

Author SHA1 Message Date
yintao e435fca0e2 fs_file.c: modify files_countlist comments
Signed-off-by: yintao <yintao@xiaomi.com>
2024-10-13 02:27:02 +08:00
xuxin19 351781d601 cmake:refine nuttx cmake build system fix CMake build missing part
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-13 02:25:06 +08:00
yinshengkai c23878e442 sched: modify CONFIG_DUMP_ON_EXIT to CONFIG_SCHED_DUMP_ON_EXIT
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-13 02:06:38 +08:00
guohao15 69f3774f30 littlefs:remove the '/' in the end of relpath in mkdir
mkdir /data/log   success
mkdir /data/log/  failed  in littlefs (but fatfs/yaffs/tmpfs success)

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-10-11 15:46:02 +08:00
ligd da5839c6f2 littlefs: fix warnings
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-11 15:46:02 +08:00
zhouliang3 8f6ea8896f fs/littlefs: revert fstat and use lfs_file_attr function
Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
2024-10-11 15:46:02 +08:00
Jiuzhu Dong c5779297cf littlefs/stat: return OK when stat success
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2024-10-11 15:46:02 +08:00
zhouliang3 0ab637f57e fs/littlefs: Add attr to dirA
Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
2024-10-11 15:46:02 +08:00
zhouliang3 f70de1c65f fs/littlefs: Fix the bug of missing file types
Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
2024-10-11 15:46:02 +08:00
zhouliang3 44992c8821 fs/littlefs: Implement fchstat and chstat of littlefs
Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
2024-10-11 15:46:02 +08:00
guohao15 38f0056dcd romfs:extend romfs to enable write part4
add sem for write safe

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-10-11 10:42:20 +08:00
Xiang Xiao 322765b442 fs/romfs: Align up the file size to 16 bytes
and set volume size to 96 bytes in romfs_mkfs

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-11 10:42:20 +08:00
Xiang Xiao 7814c40a99 fs/romfs: Replace strlcpy and strcmp with memcpy and memcmp
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-11 10:42:20 +08:00
Xiang Xiao 4d9512f0d4 fs/romfs: Add romfs_devstrcpy and romfs_devmemcpy
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-11 10:42:20 +08:00
Xiang Xiao 808beabc83 fs/romfs: Compute rf_endsector correctly when the file end on the sector boundary
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-11 10:42:20 +08:00
Xiang Xiao cca7b7cb37 fs/romfs: romfs_read return the partail read size instead error code
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-11 10:42:20 +08:00
Xiang Xiao 96900845a5 fs/romfs: Change the type of num from uint8_t to uint16_t
to support the directory with more than 255 files

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-11 10:42:20 +08:00
Xiang Xiao 4ebcc130b9 fs/romfs: Remove the reference to OK and ERROR
and fix the minor style issue

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-11 10:42:20 +08:00
guohao15 23aef2d7b4 romfs:extend romfs to enable write part3
add romfs_mkfs to support autoformat && forceformat

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-10-11 10:42:20 +08:00
guohao15 7d8d766018 romfs:bugfix use origoffset instead of offset
origoffset represent the offset of current node
offset represent the offset of the file when
the current node is a soft or hard link

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-10-11 10:42:20 +08:00
guohao15 3e58620ccc romfs:bugfix romfs_statfs
fix for df cmd infomation of romfs

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-10-11 10:42:20 +08:00
guohao15 c61734a469 romfs:extend romfs to enable write part2
add sparelist api

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-10-11 10:42:20 +08:00
guohao15 f3840cf141 romfs:extend romfs to enable write part1
change romfs_cachenode to find all headers

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-10-11 10:42:20 +08:00
yinshengkai e4e355d164 fs: Set the poll return value according to the man manual
The man manual describes that poll only has EFAULT, EINTR, EINVAL, and ENOMEM return values.
If a file returns an error, the POLLERR event should be set and OK should be returned
https://man7.org/linux/man-pages/man2/poll.2.html

When using libuv to poll the socket, the socket poll returned an EBUSY error, causing libuv to abort.

The expected logic should be to return OK, allowing libuv to notify the event listener that the POLLERR event occurred.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-11 03:08:05 +08:00
yinshengkai 36ddb46dba fs/poll: remove poll_teardown unused parameter
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-11 03:08:05 +08:00
zhengyu9 bc7114ab16 fs/vfs: result_independent_of_operands
timeout is a type of int
in MSEC2TICK, timeout may be multiplied by USEC_PER_MSEC
and the result may be out of range of int
Besides, this will induce following ERROR while running simulator:
vfs/fs_poll.c:498:38: runtime error: signed integer overflow:
19768268 * 1000 cannot be represented in type 'int'

Signed-off-by: zhengyu9 <zhengyu9@xiaomi.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-11 03:08:05 +08:00
Neo Xu d598da80e4 Rename group_argvstr to nxtask_argvstr
Now argument vector is stored to TLS, task_argvstr fits better.

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-10-10 23:13:37 +08:00
dongjiuzhu1 5a29652d2a fs/inode: using read-lock to protect inode_find
inode_find don't need to modify inode tree

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-10 16:42:15 +08:00
yintao 37a30023f5 nuttx/drivers: add ept_release_cb for destroy server resource
use ept_release_cb to destory rpmsg services server dile resource
to avoid the used-after-free issue

Signed-off-by: yintao <yintao@xiaomi.com>
2024-10-10 08:44:29 +08:00
Yongrong Wang 60ab9ae37e virtio_9p.c: fix compile error in OpenAMP upgrade feature reflow to dev
v9fs/virtio_9p.c:223:3: error: too few arguments to function 'virtio_negotiate_features'
  223 |   virtio_negotiate_features(vdev, 1 << VIRTIO_9P_MOUNT_TAG);
v9fs/virtio_9p.c:245:9: error: too few arguments to function 'virtio_create_virtqueues'
  245 |   ret = virtio_create_virtqueues(vdev, 0, 1, vqname, callback);

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2024-10-09 23:32:58 +08:00
wangyongrong 8e799ff823 rpmsg: upgrade API passing on parameters with the upgrade of OpenAMP
All the rpmsg transport layer and rpmsg services sync the API
with new OpenAMP

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-10-09 23:32:58 +08:00
zhangshoukui 10c0d00e6d Fix to compile parameters not taking effect When cmake version is greater than 3.18
https://cmake.org/cmake/help/latest/command/set_source_files_properties.html

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-10-09 18:12:50 +08:00
cuiziwei e98d018265 nuttx/fs:Rename node with inode.
In ./fs/inode directory, the variable name FAR struct inode *node is named inconsistently, with some using node and others using inode. To facilitate understanding, we will standardize the naming to FAR struct inode *inode.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-09 14:16:09 +08:00
Xiang Xiao 35d3365577 fs/vfs: Avoid calling stat with oldrelpath twice in mountptrename
and return error directly if stat return failure

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-09 12:38:12 +08:00
xuxingliang 3d31e84749 fs: fix wrong config for FS_SHMFS
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-09 10:18:15 +08:00
ligd d473fa24a7 mq: correct inode release in mq_inode_release()
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-09 10:17:24 +08:00
fangxinyong f2cc9e8410 fs: support VFS-based named event group
This extension for the event group, to establish a connection between
named event groups and a task. The task may reference the event group
associated with a VFS-based name. Then the event group can be used
in subsequent calls to nxevent_wait() or nxevent_post().

This is an internal OS interface and should not be used by applications.

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2024-10-09 01:40:00 +08:00
xuxingliang 74725b9412 procfs: access tcb in critical section
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-08 23:55:59 +08:00
anjiahao fb176c02ca gdb/thread.py:Remove dependence on g_current_regs
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-08 23:55:59 +08:00
buxiasen 067ec7bab1 fs/procfs: fix cmake no mm_pressure, fix kernel build error
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-08 23:55:59 +08:00
anjiahao 60aa08e365 procfsmeminfo:move heap name to last,avoid display misalignment
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-08 23:55:59 +08:00
buxiasen 9f2b08a91a memdump: add dump for the orphan nodes(neighbor of free node)
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-08 23:55:59 +08:00
buxiasen fd9a9f67cc memdump: add biggest allocated node dump
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-08 23:55:59 +08:00
buxiasen fd6634ecb5 mm/dump: make macro more common, fix help prompt
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-08 23:55:59 +08:00
xuxingliang 3a86098c9e fs: fix compile break
/home/neo/projects/vela/nuttx/fs/vfs/fs_dup2.c: In function 'file_dup3':
/home/neo/projects/vela/nuttx/fs/inode/inode.h:73:35: error: implicit declaration of function '_SCHED_GETTID' [-Werror=implicit-function-declaration]
   73 |           int n = sched_backtrace(_SCHED_GETTID(), \
      |                                   ^~~~~~~~~~~~~
/home/neo/projects/vela/nuttx/fs/vfs/fs_dup2.c:177:3: note: in expansion of macro 'FS_ADD_BACKTRACE'
  177 |   FS_ADD_BACKTRACE(filep2);

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-08 23:24:13 +08:00
fangxinyong d63056bd72 fs/semaphore: fix a minor issue with goto label
Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2024-10-08 23:21:54 +08:00
chenrun1 d154755729 files_getlist:Handling the situation when tcb's grouplist is empty
Summary:
  When the device reboot through reboot_notify to notify the task fsync time, if there is a task in the exit process, there may be priority robbed off the phenomenon, and at this time the group->tg_filelist crefs has been 0, resulting in the ASSERT

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-10-08 22:29:29 +08:00
chenrun1 58044e3026 fs_open:Adjust the definition of the open path
Summary:
  Reference https://man7.org/linux/man-pages/man2/open.2.html
       EISDIR pathname refers to a directory and the access requested
              involved writing (that is, O_WRONLY or O_RDWR is set).

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-10-08 22:21:33 +08:00
anjiahao 6382b02d2b zipfs:zipfs not need mtd drivers
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-08 19:55:09 +08:00
Bowen Wang 064eb5fd35 rpmsg services: should release the tx buffer when rpmsg_send_nocopy failed
Otherwise, the tx buffer will be discarded and can no longer be obtained

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-08 18:26:39 +08:00