-
-
Notifications
You must be signed in to change notification settings - Fork 151
feat(fs): 补充mount系统调用,增加对硬盘挂载 & ext4文件系统的支持 #1182
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
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
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.
然后,这个ext4的实现有无更具体的测试方法&用例的说明?麻烦补充该文件系统相关信息&对mount机制的修改到文档里面。
我还很好奇一个问题,这个ext4在dragonos里面读写&创建多个目录等等暴力测试之后,回到linux里面fsck会不会报错?
kernel/src/filesystem/ext4/inode.rs
Outdated
pub fn new_ref(&self, inode: u32) -> Result<Arc<Self>, SystemError> { | ||
if self | ||
.concret_fs() | ||
.getattr(inode) | ||
.map_err(SystemError::from)? | ||
.ftype | ||
!= another_ext4::FileType::Directory | ||
{ | ||
Ok(Arc::new_cyclic(|me| Ext4Inode { | ||
inode, | ||
fs_ptr: self.fs_ptr.clone(), | ||
page_cache: Some(PageCache::new(Some(me.clone() as Weak<dyn IndexNode>))), | ||
})) | ||
} else { | ||
Ok(Arc::new(Ext4Inode { | ||
inode, | ||
fs_ptr: self.fs_ptr.clone(), | ||
page_cache: None, | ||
})) | ||
} | ||
} |
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.
目录也可以有page cache鸭
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.
DragonOS/kernel/src/filesystem/fat/fs.rs
Lines 243 to 246 in a951a88
if !inode.0.lock().inode_type.is_dir() { | |
let page_cache = PageCache::new(Some(Arc::downgrade(&inode) as Weak<dyn IndexNode>)); | |
inode.0.lock().page_cache = Some(page_cache); | |
} |
page cache其实没有测试,只是初步按照 fat 里的写法实现了一个
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
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.
需要补充文档。 |
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
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.
https://docs.dragonos.org.cn/kernel/filesystem/vfs/index.html
MountableFS不是一种文件系统类型,这个我理解是与内核的挂载机制比较关联的。因此请把文档写到vfs下面。
并且,文档需要添加一些关于相关设计的整体的描述(可以结合ascii 图或者mermaid图),不要像个api文档一样,贴一堆代码。
如果是代码相关的内容,直接写代码注释就好了。文档是为了给开发者进行原理性质的讲解。(虽然现在有很多写的不好的文档,全都是代码在那,后面得改)
a GOOD Example: https://docs.dragonos.org.cn/kernel/ipc/signal.html
另一个问题就是,没有任何教程教我如何挂载ext4的文件系统到dragonos里面。至少我现在看了脚本也还不怎么清楚相关操作是怎么做的。 |
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
Signed-off-by: sparkzky <[email protected]>
No description provided.