Commit graph

13 commits

Author SHA1 Message Date
zhangyuan29
dcea1b90e7 arch_atomic: only support atomic_xx and atomic64_xx function
Modify the kernel to use only atomic_xx and atomic64_xx interfaces,
avoiding the use of sizeof or typeof to determine the type of
atomic operations, thereby simplifying the kernel's atomic
interface operations.

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2024-12-04 14:03:14 +01:00
wangjianyu3
0702dc5361 fs/vfs: Fix initialization of g_pseudofile_ops
Config: sim:nsh

Log

  CC:  driver/fs_registerblockdriver.c vfs/fs_pseudofile.c:99:3: warning: initialization of ‘ssize_t (*)(struct file *, const struct uio *)’ {aka ‘long int (*)(struct file *, const struct uio *)’} from incompatible pointer type ‘int (*)(struct inode *)’ [-Wincompatible-pointer-types]
      99 |   pseudofile_unlink,   /* unlink */
         |   ^~~~~~~~~~~~~~~~~
  vfs/fs_pseudofile.c:99:3: note: (near initialization for ‘g_pseudofile_ops.readv’)

Related: https://github.com/apache/nuttx/pull/13498

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-10 00:53:40 +08:00
Alin Jerpelea
6833b8787e fs: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-11-06 01:58:54 +08:00
ouyangxiangzhen
17c51c0667 userspace: Exclude nuttx/arch.h
This patch fixed userspace headers conflict. Architecture-related definition and API should not be exposed to users.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-11-01 16:59:37 +08:00
dongjiuzhu1
b2e69b86ad fs/inode: remove unnecessary return value for inode_addrefs
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-02 01:56:46 +08:00
dongjiuzhu1
09a9611ae9 fs/inode: using rwsem lock as inode_lock to avoid deadlock
Example:
When executing "df -h" on Core A to view mount information, this
process will traverse inode nodes, thereby holding the inode_lock.
Since the inode type of the mount point may be rpmsgfs, it will fetch statfs
information from another Core B.

Meanwhile, rcS on Core B needs to obtain file information from Core A,
which will be achieved by fetching stat information through rpmsgfs.
When this message arrives at Core A, a deadlock can occur between Core A's
rptun ap and nsh task.

However, both of these places involve read operations only, thus a reader-writer lock
can be utilized to prevent such a deadlock.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-02 01:56:46 +08:00
dongjiuzhu1
f9283c4e70 fs/vfs: fix compile break when enable PSEUDOFS_FILE
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-01 20:39:05 +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
buxiasen
946ed96926 fs: add fs_heap, support shm/tmpfs/pseudofile with indepent heap
For some case, need large files from tmpfs or shmfs, will lead to high
pressure on memory fragments, add an optional fs_heap with independent
heap will benifit for memory fragments issue.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-08-25 22:12:37 +08:00
guohao15
86e00896d3 fs:notify add support for inotify
support API: open close read write unlink mkdir rename fchstat rmdir symlink

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 01:50:37 +08:00
ThomasNS
696717b28b add munmap logic to pseudofs 2023-10-13 03:17:27 +08:00
dongjiuzhu1
8336ee78b8 vfs/fs_pseudofile: fix coverity issue
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-31 22:22:58 -07:00
dongjiuzhu1
0f6d0eac52 fs/pesudofile: support pseudo-file operation
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-31 22:22:58 -07:00