/* Free the directory structure and release the memory. */
STATIC VOID FatFreeODir(IN FAT_ODIR *ODir)
/* Free the directory structure and release the memory. */
STATIC VOID FatFreeODir(IN FAT_ODIR *ODir)
{
  FAT_DIRENT  *DirEnt;
  while (!IsListEmpty (&ODir->ChildList)) {
    DirEnt = DIRENT_FROM_LINK (ODir->ChildList.ForwardLink);
    RemoveEntryList (&DirEnt->Link);
    ASSERT (DirEnt->OFile == NULL);
    FatFreeDirEnt (DirEnt);
  }
  FreePool (ODir);
}