zhangshoukui
8155102f7d
FS_RAMMAP depends on FS_REFCOUNT and remove useless macro
...
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-10-10 15:30:41 +02:00
zhangshoukui
e6b703c29f
Should call fs_putfilep put fs reference when call files_fget complete
...
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-10-10 15:30:41 +02:00
xuxingliang
a26051e7bc
fs: fix wrong config for FS_SHMFS
...
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-10 00:29:57 +08:00
dongjiuzhu1
a2845faee3
fs/chmod/fchmod/lchmod: only set permissions by mode_t and ignore other bits
...
test case:
int main(void)
{
struct stat buf;
int ret;
stat("test1.t", &buf);
printf("test1.t st.mode:%x\n", buf.st_mode);
stat("test.t", &buf);
printf("test.t st.mode:%x\n", buf.st_mode);
ret = chmod("test1.t", buf.st_mode);
if (ret == 0)
{
stat("test1.t", &buf);
printf("test1.t st.mode:%x\n", buf.st_mode);
}
return 0;
}
>>
test1.t st.mode:81b4
test.t st.mode:81fd
test1.t st.mode:81fd
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-23 14:57:37 +08:00
chenrun1
03f215b374
nuttx/atomic.h:fix Fixed the pragma of ATOMIC_VAR_INIT in clang
...
Error: vfs/fs_epoll.c:126:3: error: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Werror,-Wdeprecated-pragma]
ATOMIC_VAR_INIT(1), /* i_crefs */
^
/Applications/Xcode_15.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stdatomic.h:54:41: note: macro marked 'deprecated' here
^
1 error generated.
make[1]: *** [fs_epoll.o] Error 1
Error: socket/socket.c:78:3: error: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Werror,-Wdeprecated-pragma]
ATOMIC_VAR_INIT(1), /* i_crefs */
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-09-23 14:07:03 +08:00
chenrun1
4cec713dbf
fs_inode:Change the type of i_crefs to atomic_int
...
Summary:
1.Modified the i_crefs from int16_t to atomic_int
2.Modified the i_crefs add, delete, read, and initialize interfaces to atomic operations
The purpose of this change is to avoid deadlock in cross-core scenarios, where A Core blocks B Core’s request for a write operation to A Core when A Core requests a read operation to B Core.
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-09-23 14:07:03 +08:00
wangjianyu3
b30f866f80
Thermal: Add procfs file nodes
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
guoshichao
f01a2c70fd
greenhills: fix the enumerated type mixed using warning
...
CC: obstack/lib_obstack_printf.c "mmap/fs_rammap.c", line 126: warning #188-D: enumerated type mixed with
another type
enum mm_map_type_e type = (uintptr_t)entry->priv.p & 3;
^
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-09-19 14:08:07 +08:00
Shoukui Zhang
5d3d123272
BCH: Add readonly configuration for BCH devices
...
Signed-off-by: Shoukui Zhang <zhangshoukui@xiaomi.com>
2024-09-19 03:53:20 +08:00
ligd
90dcd5edd3
critmonitor: add caller support
...
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-09-19 03:16:14 +08:00
yinshengkai
e28b311b78
Make each function of SCHED_CRITMONITOR independent
...
There will be a large performance loss after SCHED_CRITMONITOR is enabled.
By isolating thread running time-related functions, CPU load can be run with less overhead.
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-09-19 03:16:14 +08:00
anjiahao
5952bc7392
fs_dup2:fix inode->i_crefs counting error
...
file_ioctl failed, but close success, inode need release
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-09-19 02:55:13 +08:00
zhangshoukui
3fb6b4c9ec
fix mmap compile error.
...
mmap/fs_rammap.c:81:39: error: expected ‘)’ before ‘PRIdOFF’
81 | ferr("ERRORL Seek to position %"PRIdOFF" failed\n", fpos);
| ^~~~~~~
mmap/fs_rammap.c:81:12: warning: spurious trailing ‘%’ in format [-Wformat=]
81 | ferr("ERRORL Seek to position %"PRIdOFF" failed\n", fpos);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
mmap/fs_rammap.c:81:37: note: format string is defined here
81 | ferr("ERRORL Seek to position %"PRIdOFF" failed\n", fpos);
| ^
In file included from mmap/fs_rammap.c:30:
mmap/fs_rammap.c:98:51: error: expected ‘)’ before ‘PRIdOFF’
98 | ferr("ERROR: Write failed: offset=%"PRIdOFF" nwrite=%zd\n",
| ^~~~~~~
mmap/fs_rammap.c:98:20: warning: spurious trailing ‘%’ in format [-Wformat=]
98 | ferr("ERROR: Write failed: offset=%"PRIdOFF" nwrite=%zd\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mmap/fs_rammap.c:98:49: note: format string is defined here
98 | ferr("ERROR: Write failed: offset=%"PRIdOFF" nwrite=%zd\n",
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-09-19 01:43:50 +08:00
chenrun1
250353240c
rammap:Adjust the lower two bits to represent type
...
Summary:
In rammap:
1.0 - User
2.1 - Kernel
3.2 - XIP
Therefore we need to use 2 bits to represent the type
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-09-19 01:43:50 +08:00
chenrun1
c9148fbb0a
fs_msync:Fix crash caused under the anonymous mapping
...
Summary:
Limitations of using fs putfile
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-09-19 01:43:50 +08:00
chenrun1
d04205aa3d
fs/mmap/msync:support msync.
...
Summary:
1.Added msync callback in struct mm_map_entry_s
2.Added msync API in fs_msync.c
3.Added static msync_rammap for rammap.
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-09-19 01:43:50 +08:00
wanggang26
484600bd75
mmap: add xip mmap type support
...
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-09-19 01:43:50 +08:00
chao an
3cce16dd0c
fs/dump: correct SCHED_DUMP_ON_EXIT to DUMP_ON_EXIT
...
1. correct SCHED_DUMP_ON_EXIT to DUMP_ON_EXIT
2. dump file list only if DUMP_ON_EXIT enabled
Signed-off-by: chao an <anchao@lixiang.com>
2024-09-18 23:48:31 +08:00
zhangshoukui
baa716a85d
fs: Dump the list of files when the file description runs out
...
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-09-18 13:48:45 +08:00
Shoukui Zhang
175fcb799e
add sched note for littlefs/romfs/rpmsgfs
...
Signed-off-by: Shoukui Zhang <zhangshoukui@xiaomi.com>
2024-09-17 15:21:54 -03:00
simbit18
583f025422
Fix Kconfig style
...
Remove spaces from Kconfig files
Add TABs
Replace help => ---help---
2024-09-17 22:16:41 +08:00
YAMAMOTO Takashi
a78622d7bf
file_read: fix a bogus cast
2024-09-17 20:10:31 +08:00
zhangshoukui
13dd7bbfb3
Add reference count configuration
...
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-09-17 12:01:53 +08:00
zhangshoukui
0b084308ba
Fix Multiple close fd when SMP enable
...
task1:
The refs is 0 but the inode has not been released
task2:
Executing files_duplist, get filep with refs is zero, but the inode has not yet released.
[ 0.530600] [CPU1] [ 6] [ ALERT] [ap] sched_dumpstack: backtrace:
[ 0.530800] [CPU1] [ 6] [ ALERT] [ap] sched_dumpstack: [ 6] [<0x4045172>] backtrace_unwind+0x241/0x244
[ 0.531200] [CPU1] [ 6] [ ALERT] [ap] sched_dumpstack: [ 6] [<0x4009150>] sched_backtrace+0x27/0x4c
[ 0.531500] [CPU1] [ 6] [ ALERT] [ap] sched_dumpstack: [ 6] [<0x402f0fa>] sched_dumpstack+0x3d/0xa0
[ 0.531700] [CPU1] [ 6] [ ALERT] [ap] sched_dumpstack: [ 6] [<0x4002c90>] _assert+0x1e3/0x564
[ 0.532000] [CPU1] [ 6] [ ALERT] [ap] sched_dumpstack: [ 6] [<0x40221f6>] __assert+0x19/0x24
[ 0.532200] [CPU1] [ 6] [ ALERT] [ap] sched_dumpstack: [ 6] [<0x41fe376>] tcp_stop_monitor+0x61/0x6c
[ 0.532500] [CPU1] [ 6] [ ALERT] [ap] sched_dumpstack: [ 6] [<0x41fe19e>] tcp_close+0xad/0xdc
[ 0.532700] [CPU1] [ 6] [ ALERT] [ap] sched_dumpstack: [ 6] [<0x41ecc18>] inet_close+0x7b/0x8c
[ 0.533000] [CPU1] [ 6] [ ALERT] [ap] sched_dumpstack: [ 6] [<0x41ec374>] psock_close+0x27/0x70
[ 0.533300] [CPU1] [ 6] [ ALERT] [ap] sched_dumpstack: [ 6] [<0x420b68e>] sock_file_close+0x15/0x3c
[ 0.533500] [CPU1] [ 6] [ ALERT] [ap] sched_dumpstack: [ 6] [<0x4206704>] file_close+0x1f/0x80
[ 0.533800] [CPU1] [ 6] [ ALERT] [ap] sched_dumpstack: [ 6] [<0x4205278>] files_duplist+0x39f/0x45c
[ 0.534100] [CPU1] [ 6] [ ALERT] [ap] sched_dumpstack: [ 6] [<0x4000e3c>] group_setuptaskfiles+0x57/0xc0
[ 0.534300] [CPU1] [ 6] [ ALERT] [ap] sched_dumpstack: [ 6] [<0x400bc6c>] nxtask_init+0x5b/0x13c
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-09-17 12:01:53 +08:00
Xiang Xiao
744da99250
Fix vfs/fs_fstatfs.c:60:21: warning: variable 'inode' set but not used
...
60 | FAR struct inode *inode;
| ^~~~~
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-09-17 12:01:53 +08:00
Shoukui Zhang
43223124ec
vfs/file: add reference counting to prevent accidental close during reading writing...
...
Signed-off-by: Shoukui Zhang <zhangshoukui@xiaomi.com>
2024-09-17 12:01:53 +08:00
wanggang26
89e5ceb51e
vfs:fix a type mismatch issue and a typo
...
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-09-16 11:24:56 -03:00
dongjiuzhu1
d2591380ae
Revert "fs/mount and fs/romfs: Add support to mount a ROMFS volume using an MTD driver interface using the standard mount() operation."
...
This reverts commit 5708a1ac73
.
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-16 12:27:40 +08:00
dongjiuzhu1
ace2683492
fs/mount: add ftl proxy to mount block filesystem on mtd device
...
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-16 12:27:40 +08:00
Masayuki Ishikawa
df298c186f
Revert "build depend:Revert Make.dep intermediate ddc file"
...
This reverts commit ddc3119c4e
.
2024-09-15 19:29:47 +08:00
anjiahao
63db77628e
stack record: fix ps can't show stack used
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-09-15 10:25:48 +08:00
anjiahao
632b13fe03
stack recored:Fixed the problem of missing the 0th data in statistics
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-09-15 10:25:48 +08:00
wangjianyu3
1bb0f19fd5
fs/rename: Do not send notify if the same
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-15 10:11:42 +08:00
xuxin19
ddc3119c4e
build depend:Revert Make.dep intermediate ddc file
...
Revert "Parallelize depend file generation"
This reverts commit d5b6ec450f
.
parallel depend ddc does not significantly speed up compilation,
intermediately generated .ddc files can cause problems if compilation is interrupted unexpectedly
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-09-15 10:01:58 +08:00
ligd
fab9369093
poll: fix thread_cancel() caused poll used after free
...
pthread 0 pthread1
fd 0
poll_setup
wait
cancel(thread 0)
fd 0 close
fd 0 notify (sem used after free)
poll_teardown
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-09-14 20:15:12 +08:00
ouyangxiangzhen
0451ead2c5
fs/mmap: Ensure anonymous pages are initialized to zero
...
According to the mmap(2) specification, anonymous pages should be initialized to zero unless the MAP_UNINITIALIZED is specified.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-09-13 09:10:21 +08:00
ligd
6a2c03732f
clock: Replace all ts and tick conversion functions
...
Using the ts/tick conversion functions provided in clock.h
Do this caused we want speed up the time calculation, so change:
clock_time2ticks, clock_ticks2time, clock_timespec_add,
clock_timespec_compare, clock_timespec_subtract... to MACRO
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-09-12 18:14:39 +08:00
dongjiuzhu1
00e878e848
fs/inode: add reference to protect filelist of group
...
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-10 15:16:19 +08:00
zhanghongyu
420648b0c6
drivers/pipes: add fcntl(F_SETPIPE_SZ/F_GETPIPE_SZ) support
...
allows user programs to modify pipe size, but not larger than
CONFIG_DEV_PIPE_MAXSIZE
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-09-10 11:35:15 +08:00
Alexey Matveev
f56b7b8c06
smartfs procfs: fix double declare g_smartfs_operations
2024-09-10 11:32:32 +08:00
dongjiuzhu1
43d0d95f81
fs/inode: using inode reference to indicate unlink and simply code
...
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-09 08:42:34 +08:00
dongjiuzhu1
c6815bba3b
fs/mount: move inode_lock to before bind to avoid deadlock(nsh and rptun)
...
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-09 08:42:34 +08:00
dongjiuzhu1
2a8c023357
fs/inode: using orig_row to ensure correct free logic
...
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-09 01:24:08 +08:00
dongjiuzhu1
6542806248
fs/inode: fix assert when free error address
...
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-09 01:24:08 +08:00
Xiang Xiao
659448a9d8
fs/hostfs: Replace strcpy with memcpy
...
The strcpy function is dangerous because it does not check the length of the
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-09-06 12:27:55 +08:00
hujun5
198630a809
sched: use this_task replace nxsched_self
...
reason:
We can reduce a function call to improve performance.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-05 09:33:50 -03:00
Saurav Pal
fc31c61730
boards/sim: Defconfigs for nand and mnemofs
...
Adds nand and mnemofs sim configs.
Signed-off-by: Saurav Pal <resyfer.dev@gmail.com>
2024-09-05 11:02:05 +08:00
chao an
39e873f269
sched/policy: move g_policy from data to rodata
...
Signed-off-by: chao an <anchao@lixiang.com>
2024-09-02 18:23:57 +08:00
Yanfeng Liu
32801d3047
fs/mq_open: revising comments
...
This contains minor revision on comments of `file_mq_open()`.
Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-08-31 12:04:17 -03:00
yinshengkai
263f8955da
fs/procfs: Supports any number of thread displays
...
After the number of threads exceeds the array size, it will not be displayed.
Any number of threads can be displayed using dynamic adaptation
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-08-28 14:01:25 +08:00