Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • O OSKernel2026-StellaOS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • StellaOS
  • OSKernel2026-StellaOS
  • Merge requests
  • !25

filesystem: 将自旋锁替换为 UP 单核同步原语

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged StellaOS requested to merge feature/fs_up_sync into main Jun 02, 2026
  • Overview 0
  • Commits 18
  • Pipelines 0
  • Changes 91

将 filesystem crate 中所有 spin::Mutex / spin::RwLock 替换为轻量的 UP 专用同步类型,消除对 spin crate 的直接依赖。

新增:

  • sync.rs: UPIntrFreeCell(RefCell + 关中断),用于全局共享数据
  • sync.rs: UPSafeCellRaw(UnsafeCell),用于单持有者数据

锁替换策略:

  • 全局缓存/注册表(PAGE_CACHE/DENTRY_CACHE/BLOCK_DEVICES/FILE_SYSTEMS/ ROOT_DENTRY)→ UPIntrFreeCell,保持关中断语义,防止定时器抢占导致 RefCell double-borrow panic
  • Dentry.op_lock → 删除。UP 协作式调度下 VFS 命名空间操作路径不会 yield, 无 TOCTOU 风险
  • Dentry.inner / File.offset / Pipe/Console/Tty buffer / RamInode.inode_type → UPSafeCellRaw,单核下天然互斥,零开销
  • 中断开关通过 extern "C" 符号注入(stella_intr_disable/enable/enabled), 内核侧委托给 polyhal::IRQ,filesystem 不依赖任何架构 crate
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: feature/fs_up_sync