Fixed a bug that the efs lock was not be held correctly
This commit is contained in:
parent
0d3010fb87
commit
569e2fe2fe
2 changed files with 19 additions and 10 deletions
|
@ -112,8 +112,12 @@ impl EasyFileSystem {
|
|||
|
||||
pub fn root_inode(efs: &Arc<Mutex<Self>>) -> Inode {
|
||||
let block_device = Arc::clone(&efs.lock().block_device);
|
||||
// acquire efs lock temporarily
|
||||
let (block_id, block_offset) = efs.lock().get_disk_inode_pos(0);
|
||||
// release efs lock
|
||||
Inode::new(
|
||||
0,
|
||||
block_id,
|
||||
block_offset,
|
||||
Arc::clone(efs),
|
||||
block_device,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue