Closed gaotianyu1350 closed 5 years ago
LGTM. BTW, what's the usage of
link_inodeimpl
?
link_inodeimpl(device_file_name, inode_impl)
name: string
: name of the device fileinode_impl: &Arc<INodeImpl>
: which represents the device fileeg:
// add device to sfs
SFS.new_device_inode(1, STDIN.clone()) // STDIN is INode implementing stdin
// get a new INodeImpl of a device
let stdin_inodeimpl = SFS.new_inode_chardevice(1) // 1 is the device number
// link it to /dev
dev_inode_impl.link_inodeimpl("stdin", &stdin_inodeimpl) // dev_inode_impl is INodeImpl of "/dev"
Okay, got it.
Add some functions and attributes to INodeImpl and SimpleFileSystem in rcore-fs-sfs to support char device.