Skip to content

fs: add hostfs/rpmsgfs link/symlink/readlink/lstat backends - #19990

Merged
GUIDINGLI merged 5 commits into
apache:masterfrom
Kaben123:pse52-03-fs-backends
Aug 28, 2026
Merged

fs: add hostfs/rpmsgfs link/symlink/readlink/lstat backends#19990
GUIDINGLI merged 5 commits into
apache:masterfrom
Kaben123:pse52-03-fs-backends

Conversation

@Kaben123

Copy link
Copy Markdown

Summary

Implement link, symlink, readlink, and lstat support for the hostfs and rpmsgfs filesystem backends, utilizing the mountpt_operations interfaces added in #19949.

This is PR#3 of a 4-part PSE52/POSIX filesystem enhancement series:

Changes (4 commits)

  1. fs/hostfs: move global lock into hostfs_mountpt_s — Replace the global g_lock with a per-filesystem fs->fs_lock, improving concurrency for multi-mount scenarios.

  2. fs/hostfs: change fs_heap to lib_tempbuffer — Migrate hostfs path buffer allocation from fs_heap/stack arrays to the lib_get_tempbuffer/lib_put_tempbuffer system, aligning with the inode layer (merged in fs/inode: add POSIX path-resolution infrastructure #19950).

  3. fs/hostfs: add link, symlink, readlink and lstat support — Implement the four operations for hostfs, including arch host stubs for sim/arm/arm64/risc-v/xtensa. Adds the necessary nuttx_host_link, nuttx_host_symlink, nuttx_host_readlink, and nuttx_host_lstat host-side functions.

  4. fs/rpmsgfs: add link, symlink, readlink and lstat support — Implement the four operations for rpmsgfs, adding the corresponding client RPC handlers and server-side dispatch.

Testing

  • sim:nsh with CONFIG_FS_HOSTFS=y + CONFIG_FS_LINKS=y: builds cleanly, zero errors, zero warnings.

Impact

  • 14 files changed, +1155/−129 lines
  • No breaking changes — new operations are added at the end of the ops table with NULL placeholders in unaffected filesystems

@github-actions github-actions Bot added Arch: arm Issues related to ARM (32-bit) architecture Arch: arm64 Issues related to ARM64 (64-bit) architecture Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture Arch: simulator Issues related to the SIMulator Arch: xtensa Issues related to the Xtensa architecture Area: File System File System issues Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces. labels Aug 28, 2026
jasonbu and others added 5 commits August 28, 2026 14:14
Replace the global `g_lock` with a per-filesystem `fs->fs_lock`
to improve concurrency for multi-mount scenarios.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
Migrate hostfs path buffer allocation from fs_heap and stack
arrays to lib_get_tempbuffer/lib_put_tempbuffer.

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
Implemented link(), symlink(), readlink() and lstat() in hostfs.

Signed-off-by: zhengyu16 <zhengyu16@xiaomi.com>
Implement link(), symlink(), readlink() and lstat() in rpmsgfs.

Signed-off-by: zhengyu16 <zhengyu16@xiaomi.com>
Add missing blank lines after declarations and fix one bad alignment
in hostfs/rpmsgfs-related files. These are pre-existing style issues
flagged by CI's whole-file nxstyle check when our PR touches these
files. No logic change (git diff -w is blank-line-only additions).

Signed-off-by: yukangzhi <yukangzhi@xiaomi.com>
@Kaben123
Kaben123 force-pushed the pse52-03-fs-backends branch from 318ed14 to 595b1f1 Compare August 28, 2026 06:15
@github-actions

Copy link
Copy Markdown

MemBrowse Memory Report

qemu-armv8a

  • Code: .text.hostfs_bind +32 B, .text.hostfs_chstat +40 B, .text.hostfs_close -4 B, .text.hostfs_closedir -4 B, .text.hostfs_fchstat -4 B, .text.hostfs_fstat -4 B, .text.hostfs_ftruncate -4 B, .text.hostfs_ioctl -4 B, .text.hostfs_mkdir +32 B, .text.hostfs_open +28 B, .text.hostfs_opendir +48 B, .text.hostfs_read -4 B, .text.hostfs_readdir -4 B, .text.hostfs_rename +64 B, .text.hostfs_rewinddir -4 B, .text.hostfs_rmdir +40 B, .text.hostfs_seek -4 B, .text.hostfs_stat +32 B, .text.hostfs_statfs -4 B, .text.hostfs_sync -4 B, .text.hostfs_unbind +4 B, .text.hostfs_unlink +40 B, .text.hostfs_write -4 B (+0.1%, 319,712 B)
  • Data: -24 B (-0.0%, 76,953 B)
    No memory changes detected for:
  • arduino-mega2560
  • esp32-devkitc
  • hifive1-revb
  • mirtoo
  • qemu-intel64
  • rx65n-rsk2mb
  • s698pm-dkit
  • stm32-nucleo-f103rb

@GUIDINGLI
GUIDINGLI merged commit 9c467c5 into apache:master Aug 28, 2026
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm Issues related to ARM (32-bit) architecture Arch: arm64 Issues related to ARM64 (64-bit) architecture Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture Arch: simulator Issues related to the SIMulator Arch: xtensa Issues related to the Xtensa architecture Area: File System File System issues Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants