pub fn dirlookup(
        &mut self,
        name: &FileName<DIRSIZ>,
        ctx: &KernelCtx<'_, '_>,
    ) -> Result<(RcInode<InodeInner>, u32), ()> {
        assert_eq!(self.deref_inner().typ, InodeType::Dir, "dirlookup not DIR");

        self.iter_dirents(ctx)
            .find(|(de, _)| de.inum != 0 && de.get_name() == name)
            .map(|(de, off)| {
                (
                    ctx.kernel()
                        .fs()
                        .itable()
                        .get_inode(self.dev, de.inum as u32),
                    off,
                )
            })
            .ok_or(())
    }
/// Look for a directory entry in a directory.
/// If found, return the entry and byte offset of entry.
Look for a directory entry in a directory.
If found, return the entry and byte offset of entry.
Look for a directory entry in a directory . If found return the entry and byte offset of entry .
pub fn dirlookup(
        &mut self,
        name: &FileName<DIRSIZ>,
        ctx: &KernelCtx<'_, '_>,
    ) -> Result<(RcInode<InodeInner>, u32), ()> {
        assert_eq!(self.deref_inner().typ, InodeType::Dir, "dirlookup not DIR");
        self.iter_dirents(ctx)
            .find(|(de, _)| de.inum != 0 && de.get_name() == name)
            .map(|(de, off)| {
                (
                    ctx.kernel()
                        .fs()
                        .itable()
                        .get_inode(self.dev, de.inum as u32),
                    off,
                )
            })
            .ok_or(())
    }
pub fn dirlookup ( & mut self , name : & FileName < DIRSIZ > , ctx : & KernelCtx < ' _ , ' _ > , ) -> Result < ( RcInode < InodeInner > , u32 ) , ( ) > { assert_eq ! ( self deref_inner ( ) typ InodeType Dir " " ) ; self . iter_dirents ( ctx ) . find ( | ( de , _ ) | de . inum != 0 && de . get_name ( ) == name ) . map ( | ( de , off ) | { ( ctx . kernel ( ) . fs ( ) . itable ( ) . get_inode ( self . dev , de . inum as u32 ) , off , ) } ) . ok_or ( ( ) ) }
Look for a directory entry in a directory.
Look for a directory entry in a directory .
&mut self
name
&FileName<DIRSIZ>
ctx
&KernelCtx<'_, '_>
&mut self
name
&FileName<DIRSIZ>
ctx
&KernelCtx<'_, '_>