Commit Graph

2 Commits

Author SHA1 Message Date
LoGin 0d10f70691
feat(vfs): 新增creat系统调用支持 (#1482)
* feat(vfs): 新增creat系统调用支持

- 实现creat系统调用处理器,遵循Linux语义:创建新文件或截断现有文件并打开为只写模式
- 在x86_64架构下注册creat系统调用到系统调用表
- 在gvisor测试白名单中添加creat测试项

Signed-off-by: longjin <longjin@DragonOS.org>

* feat(rust-jhash): Update Cargo.toml to specify Rust edition 2021

---------

Signed-off-by: longjin <longjin@DragonOS.org>
2025-12-16 23:58:15 +08:00
LoGin b28f766956
feat(vfs): Implement append lock manager for file operations (#1483)
* feat(vfs): Implement append lock manager for file operations

- Introduced an `AppendLockManager` to ensure atomicity for append operations across filesystems, preventing data corruption in concurrent write scenarios.
- Updated file write methods to utilize the new append lock mechanism, ensuring that appending to files respects the latest end-of-file position.
- Enhanced `write_append` and `pwrite_append` methods to support forced append semantics, aligning with Linux behavior.
- Initialized the append lock manager during VFS initialization to ensure it is ready before any file write operations.

This addition improves the reliability of file operations in a multi-threaded environment, particularly for append scenarios.

Signed-off-by: longjin <longjin@DragonOS.org>

* feat(kernel): 添加jhash库并用于append_lock的哈希计算

Signed-off-by: longjin <longjin@DragonOS.org>

---------

Signed-off-by: longjin <longjin@DragonOS.org>
2025-12-16 23:55:53 +08:00