findDE :: HalfsCapable b t r l m =>
          DirHandle r l
       -> String
       -> FileType
       -> HalfsM b r l m (DirFindRslt DirectoryEntry)
findDE dh fname ftype = do
  mde <- withDHLock dh $ lookupDE fname dh
  case mde of
    Nothing -> return DF_NotFound
    Just de -> return $ foundRslt de (deType de) ftype

-- Exportable version of findDE; doesn't expose DirectoryEntry to caller
findDE :: HalfsCapable b t r l m =>
          DirHandle r l
       -> String
       -> FileType
       -> HalfsM b r l m (DirFindRslt DirectoryEntry)
findDE dh fname ftype = do
  mde <- withDHLock dh $ lookupDE fname dh
  case mde of
    Nothing -> return DF_NotFound
    Just de -> return $ foundRslt de (deType de) ftype

-- Exportable version of findDE; doesn't expose DirectoryEntry to caller
findDE dh fname ftype = do
  mde <- withDHLock dh $ lookupDE fname dh
  case mde of
    Nothing -> return DF_NotFound
    Just de -> return $ foundRslt de (deType de) ftype

-- Exportable version of findDE; doesn't expose DirectoryEntry to caller