pub fn namex(&self, path: &[u8], name: &[u8]) -> Result<u32, FsError> {
        let inode: Inode = if path == b"/" {
            self.read_inode(ROOT_DEV, ROOT_INUM)?
        } else {
            return Err(FsError::NotFound); // if/when we decide to support subdirectories, inode is current working directory
        };

        let (inum, _) = self.dir_lookup(&inode, name)?;
        Ok(inum)
    }
// return inum of the target file
return inum of the target file
return inum of the target file
pub fn namex(&self, path: &[u8], name: &[u8]) -> Result<u32, FsError> {
        let inode: Inode = if path == b"/" {
            self.read_inode(ROOT_DEV, ROOT_INUM)?
        } else {
            return Err(FsError::NotFound); // if/when we decide to support subdirectories, inode is current working directory
        };
        let (inum, _) = self.dir_lookup(&inode, name)?;
        Ok(inum)
    }
pub fn namex ( & self , path : & [ u8 ] , name : & [ u8 ] ) -> Result < u32 , FsError > { let inode : Inode = if path == b" " { self . read_inode ( ROOT_DEV , ROOT_INUM ) ? } else { return Err ( FsError :: NotFound ) ; // if/when we decide to support subdirectories, inode is current working directory } ; let ( inum , _ ) = self . dir_lookup ( & inode , name ) ? ; Ok ( inum ) }
return inum of the target file
return inum of the target file
&self
path
&[u8]
name
&[u8]
&self
path
&[u8]
name
&[u8]