-
-
Notifications
You must be signed in to change notification settings - Fork 166
feat(loop-device):实现Dragonos对loop的支持 #1261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
da1ac6a to
f7e4c02
Compare
f7e4c02 to
5cbe962
Compare
e9ebe47 to
be65aaa
Compare
= 添加loopdevice的四种状态
- 添加loop_add和loop_remove函数 - 添加loop_control_ioctl的loop文件私有信息,发现data可以代替 - 待完成loop_ctl的read 和write
- 修改gendisk中的默认行为,使得read和write能传递到loop_device中 - 完成loop_device的正确挂载和写入数据的行为
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR upgrades the Rust toolchain from nightly-2024-11-05 to nightly-2025-08-10 and introduces a loop device driver implementation for DragonOS.
Key changes include:
- Toolchain version update across all Makefiles and configuration files
- New loop device driver with complete device management infrastructure
- Integration of loop devices into the DevFS and block device management systems
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| user/apps/*/Makefile | Updated Rust toolchain version from nightly-2024-11-05 to nightly-2025-08-10 |
| tools/nix-dev-shell/flake.nix | Updated Rust toolchain version in Nix dev shell configuration |
| tools/Makefile | Updated cargo toolchain version for check command |
| build-scripts/Makefile | Updated cargo toolchain version for build and check commands |
| kernel/src/driver/base/block/loop_device.rs | New file implementing loop device driver with control device, manager, and device structures |
| kernel/src/driver/base/block/mod.rs | Added loop_device module and removed blank line |
| kernel/src/driver/base/block/manager.rs | Implemented unregister functionality for block devices |
| kernel/src/driver/base/block/gendisk/mod.rs | Added read/write support, dynamic metadata, and ioctl forwarding to underlying loop devices |
| kernel/src/driver/base/device/device_number.rs | Added LOOP_MAJOR constant (7) for loop devices |
| kernel/src/filesystem/vfs/file.rs | Added Loop variant to FilePrivateData enum with typo in comment |
| kernel/src/filesystem/devfs/mod.rs | Added special handling for loop-control and loop* devices in registration and removal |
| user/apps/c_unitest/test_loop.c | New test file for loop device functionality |
| config/app-blocklist.toml | Blocked NovaShell app with typo in toolchain version |
Comments suppressed due to low confidence (1)
kernel/src/driver/base/block/loop_device.rs:1
- Inconsistent indentation: line 47 has incorrect spacing (3 spaces instead of 4) compared to line 46.
use crate::{
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- feat: supplement test_loop
- add docs - delete some useless code - cargo fmt
- 修改一些注释,使其更符合rust注释规范
- 修正注释为rust语言规范
…nto feat/loop-device
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 10 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let dname = gendisk.dname()?; | ||
| devfs_unregister(dname.as_ref(), gendisk)?; | ||
| } | ||
| Ok(()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
base目录是放置那种通用组件,比如gendisk之类的。
loop设备应当单独开个目录。在driver/block下面
- 添加多线程读写并发测试
- 添加多线程读写并发测试
…nto feat/loop-device
…nto feat/loop-device

No description provided.