Commit Graph

1727 Commits

Author SHA1 Message Date
Jiuzhu Dong c18b5602e8 fs/procfs: add mempool info to proc/mempool
server> cat /proc/mempool
                   total    bsize    nused    nfree   nifree  nwaiter
       hello:        400       20       17        3        0        0

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-09 15:38:57 +08:00
Peter van der Perk fa9d352566 SPIFFS select FS_LARGEFILE since it's required 2022-08-04 22:31:57 +08:00
Peter van der Perk 93f05c7e74 NFS select FS_LARGEFILE since it's required 2022-08-04 22:31:57 +08:00
Peter van der Perk e0080766b3 FS Disable FS_LARGEFILE by default 2022-08-04 22:31:57 +08:00
haopengxiang 9bb5148d10 procfs: add heapcheck flag
1 for open heapcheck, 0 for close
echo 1 > /proc/xxx/heapcheck
echo 0 > /proc/xxx/heapcheck

Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2022-08-02 10:46:44 +08:00
Xiang Xiao 2b0e28e492 vfs: Remove the unnessary check when CONFIG_DEBUG_MM enable
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-28 16:52:06 +03:00
ligd 8a3683fb9f rptun: add ns_match callback to resolve rptun deadlock
thread A: accept -> net_lock -> socket_rpmsg_accept
          -> rpmsg_register_callabck -> rptun_lock
thread B: ns_bind -> rpmsg_socket_ns_bind -> get_tx_payload_buffer
          -> rptun_wait_tx -> usrsock_rpmsg_ept_cb -> usrsockdev_write
          -> net_lock -> deadlock

fix:
add ns_match callback

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-27 20:36:51 +08:00
Jiuzhu Dong 9899dd0ec0 mm/mm_heap: change CONFIG_MM_BACKTRACE to int type
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-26 23:45:31 +08:00
ligd c0f2b7811e pm: add pm procfs support
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 11:11:00 +08:00
ligd 5f68aa56fd poll: defalut set POLLERR POLLHUP to events
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 09:36:55 +08:00
ligd 1e5568b030 rpmsgfs: fix nx_style
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-22 17:10:19 +03:00
ligd 572d865034 rpmsgfs: cache statfs result in case of deadlock
rptun: msg from other cpu
[ap] [ 5] [<0x2c353768>] arm_switchcontext+0xc/0x10
[ap] [ 5] [<0x2c322266>] sem_wait+0x5a/0xbc
[ap] [ 5] [<0x2c7400a8>] inode_semtake+0x24/0x5c
[ap] [ 5] [<0x2c74087a>] inode_release+0x6/0x60
[ap] [ 5] [<0x2c741284>] file_close+0x18/0x44
[ap] [ 5] [<0x2c74fb06>] rpmsgfs_close_handler+0x86/0xe4
[ap] [ 5] [<0x2c75b8de>] rpmsg_virtio_rx_callback+0xba/0x1b4
[ap] [ 5] [<0x2c75af70>] rproc_virtio_notified+0x44/0x5c
[ap] [ 5] [<0x2c75a93c>] remoteproc_get_notification+0x1c/0x2c
[ap] [ 5] [<0x2c335a08>] rptun_thread+0x74/0x208
[ap] [ 5] [<0x2c323e72>] nxtask_start+0x3a/0x60

nsh: send msg to other cpu with inode lock
[ap] [10] [<0x2c353768>] arm_switchcontext+0xc/0x10
[ap] [10] [<0x2c3221b2>] nxsem_wait_uninterruptible+0x6e/0xc8
[ap] [10] [<0x2c74e498>] rpmsgfs_send_recv.constprop.0+0x78/0xc0
[ap] [10] [<0x2c74ebc0>] rpmsgfs_client_statfs+0x50/0x80
[ap] [10] [<0x2c3221ca>] nxsem_wait_uninterruptible+0x86/0xc8
[ap] [10] [<0x2c74da78>] rpmsgfs_statfs+0x28/0x50
[ap] [10] [<0x2c74534e>] mountpoint_filter+0x66/0x90
[ap] [10] [<0x2c740016>] foreach_inodelevel+0x66/0x88
[ap] [10] [<0x2c73fffa>] foreach_inodelevel+0x4a/0x88
[ap] [10] [<0x2c740062>] foreach_inode+0x2a/0x48
[ap] [10] [<0x2c745388>] foreach_mountpoint+0x10/0x20
[ap] [10] [<0x2c745606>] mount_read+0x36/0x70
[ap] [10] [<0x2c742a34>] read+0x30/0x5c
[ap] [10] [<0x2c371096>] nsh_catfile+0x36/0x140
[ap] [10] [<0x2c36d01a>] nsh_parse_command+0x7fe/0xc54
[ap] [10] [<0x2c370f92>] nsh_session+0x66/0x134
[ap] [10] [<0x2c3721a4>] nsh_consolemain+0x2c/0x44
[ap] [10] [<0x2c374fde>] nsh_main+0x2a/0x4c
[ap] [10] [<0x2c33f7f8>] lib_cxx_initialize+0x24/0x48
[ap] [10] [<0x2c34274a>] nxtask_startup+0x12/0x24
[ap] [10] [<0x2c323e7e>] nxtask_start+0x46/0x60

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-22 17:10:19 +03:00
ligd 5f60b7dc12 rpmsgfs: hande count <=0 when rpmsgfs_read&write
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-22 17:10:19 +03:00
ligd 837c15dcb6 rpmsgfs: improve file read & write performance
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-22 17:10:19 +03:00
Jiuzhu Dong 978530f5f6 fs/ioctl: add BLKSSZGET cmd to get block sector size
refer to:
https://sites.uclouvain.be/SystInfo/usr/include/sys/mount.h.html

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-22 09:07:57 +03:00
Jiuzhu Dong b385c48a30 fs/fs_fsync: add file sync operation by ioctl
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-22 09:07:57 +03:00
ligd cda9cfbc80 unlink: don't do unlink with inode_semtake
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-22 11:00:26 +08:00
ligd 1f854486c3 procfs: procfs_opendir should return fail if can't match
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-22 10:53:44 +08:00
Fotis Panagiotopoulos 66f49c1f3c mm: Fixed the usage of CONFIG_MM_BACKTRACE & CONFIG_DEBUG_MM. 2022-07-22 00:53:02 +08:00
Jukka Laitinen b10658653b fs/partition/fs_gpt.c: Fix compilation error
PRI?OFF macros are defined in inttypes, so include it

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-07-19 23:50:30 +08:00
Xiang Xiao 2166c98809 Add printflike and scanflike to all printf/scanf like functions
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-18 14:14:36 +03:00
Xiang Xiao 3276438984 procfs/mount: Unify uint[32|64]_t to fsblkcnt_t for the code simplification
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-16 21:06:53 +03:00
Xiang Xiao c211954a42 partition/gpt: Replace PRI?LBA with PRI?OFF
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-16 21:04:58 +03:00
Nathan Hartman 849f760b77 Fix various typos 2022-07-08 02:15:54 +08:00
SPRESENSE fa1fad50b9 fs/fat: Fix a bug that long file name cannot be found
The field of first cluster under LFN directory entry must be 0x0000. If
it is set a value other than 0, it causes a problem where the long file
name entry cannot be found on a Windows PC and the short file name is
always used. In addition, correct the macro error in big endian.
2022-06-30 15:35:57 +08:00
Xiang Xiao 53c6789bef mm: Add mm_uninitialize to release the resource
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-06-12 19:41:14 +09:00
chao.an 2fa7ebc18f fs/mqueue: skip nxmq_pollnotify() if no poll waiters
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-06-10 18:40:42 +09:00
Xiang Xiao 3e32b605fe libc/tls: Make tls_get_info as the pulibc function instead up_tls_info
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-06-03 23:56:50 +03:00
vxj9800 bfde3c007d Add preprocessor directive __attribute__((packed)) to cromfs_node_s
This directive tells the compiler that cromfs_node_s might be located at a memory
address which is not word aligned. This resolves the hardFault caused by unaligned
memory access on armv6-m architecture which doesn't support it.
2022-06-01 12:09:37 +08:00
anjiahao b88a8cf39f use rmutex inside of all repeated implementation
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-05-30 19:43:48 +08:00
Xiang Xiao 7ec6b4c7dd Change dpends on SCHED_[L|H]PWORK to SCHED_WORKQUEUE
since the code could map the unsupported work to the
supported one and remove select SCHED_WORKQUEUE from
Kconfig since SCHED_[L|H]PWORK already do the selection

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-28 18:41:51 +03:00
YAMAMOTO Takashi b05320cac2 mm: Move backtrace stuff into a separate option
The functionality has too much overhead for CONFIG_DEBUG_MM.
2022-05-21 14:28:41 +08:00
YAMAMOTO Takashi 0a1ac4762a littlefs_stat: Fix directory size
lfs_info.size is only valid for LFS_TYPE_REG.
For directory, use 0 instead of stack garbage.
2022-05-20 15:37:28 +03:00
Xiang Xiao 22e4f1c59a sched: Remove start from nxsem_tickwait[_uninterruptible]
to simplify both caller and callee

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-15 13:55:58 +03:00
anjiahao bc998f6072 fs:fs_getfilep changes fd judgment method
if a fd was closed,need return EBADF
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-04-19 22:48:39 +08:00
anjiahao 7ac2d3a5ac fs:oflag need consistent with psock
if don't consistent with psock,call fcntl will have differet flag
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-04-19 13:58:56 +03:00
Xiang Xiao ef1a98dd00 Remove the unneeded void cast
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-17 23:32:05 +03:00
Petro Karashchenko ebffcdc992 semaphore: fix usage of NXSEM_INITIALIZER
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-04-17 11:38:34 +08:00
Xiang Xiao f14eed6432 vfs/fcntl: Minor style fix
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-14 17:21:25 +03:00
liuhaitao 05cc6fb610 fs/fcntl: add O_APPEND flag judge in fcntl
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2022-04-14 17:21:25 +03:00
Jukka Laitinen dbc163f1b0 fs/vfs/fs_truncate.c: Use ioctl to truncate on non-mountpoint inode
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-04-13 09:40:18 +08:00
YAMAMOTO Takashi c9f3b3a7f1 littelfs: deal with block devices w/o ioctl
Note: Some block devices has ioctl == NULL. eg. drivers/loop
2022-04-11 13:38:26 +03:00
yinshengkai 4b6743591a fs/vfs: fix st_mode mask check
The full mask for st_mode is 0177777
Now modify any file permissions in hostfs and all will fail
2022-04-08 15:06:41 +03:00
Xiang Xiao 9785d6606c openamp: Change the dependence from OPENAMP to RPTUN
since all rpmsg driver need the extension api exposed by rptun driver

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-05 10:05:41 +03:00
Petro Karashchenko d08fbca679 nuttx: unify FAR attribute usage across the code
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-04-04 21:32:58 +08:00
Jiuzhu Dong 0a111b7c96 fs/rpmsgfs: fix bug about using uninit variable "times"
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-04-01 21:02:08 +08:00
ligd 6f210655fa rpmsgfs: do NOT access the pointer when do remote ioctl
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-04-01 17:39:38 +08:00
田昕 463a437733 fs and unistd: increase OPEN_MAX by claiming a Kconfig.
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-04-01 12:17:47 +03:00
Jiuzhu Dong 8a80a853b7 fs/romfs: fix string overflow when the length of rn_name exceeds NAME_MAX + 1
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-04-01 12:16:14 +03:00
Jiuzhu Dong b5fb93aefb fs/procfstcbinfo: minor bug about print address
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-04-01 12:14:52 +03:00