-
Notifications
You must be signed in to change notification settings - Fork 8
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
对simple-fat32设计的一些建议 #4
Comments
其他问题:
|
Great suggestions. What you said is exactly right, and it should be done this way. I think the best way is to add FAT32-irrelevant codes to support FAT32 implementation.
UltraOS call Operation I suggest that we don't close this issue for future discussion related to kernel design. And we can let others think more from our discussion. |
vfs.rs 中的 find_long_name 方法 for i in 0..order as usize { // 存入长名目录项位置了,第一个在栈顶
let pos = self.get_pos(offset + i);
long_pos_vec.push(pos);
} 是否应该为 for i in 0..order as usize { // 存入长名目录项位置了,第一个在栈顶
let pos = self.get_pos(offset + i * DIRENT_SZ);
long_pos_vec.push(pos);
} 另外,这个函数分支和循环结束时的 |
It's a little close to detail. I can't remember whether it should work this way, but you can try it to prove yourself. |
simple-fat32 中对偏移量的设计应该都是以字节为单位?这里是搜索长文件名目录项时,最后生成VFile返回的过程,把所有长文件名目录项的位置进行保存,get_pos是获取文件中该偏移量的扇区号和偏移位置,因此这边偏移量的传入我觉得应该是最初的偏移量加上 |
fat32_manager即fat32管理器模块中,对文件名的一些操作,比如拆分文件名和后缀、拆分长文件名、短文件名格式化、由长文件名生成短文件名等,我觉得这些算作“工具函数”,没有必要非要和 FAT32Manager 捆绑在一起(即作为它的implement),以至于每次使用这些工具时都需要获取对管理器的读锁。
我在手动把这些函数取出 impl 块后,修改对应的报错非常快,基本只要把函数前面对结构体的引用删去即可,这一实践也说明了这些函数与FAT32Manager的关联程度并不大
The text was updated successfully, but these errors were encountered: