/* Check the references of the OFile. If the OFile (that is checked) is no longer referenced, then it is freed. */
BOOLEAN FatCheckOFileRef(IN FAT_OFILE *OFile)
/* Check the references of the OFile. If the OFile (that is checked) is no longer referenced, then it is freed. */
BOOLEAN FatCheckOFileRef(IN FAT_OFILE *OFile)
{
  if (OFile->CheckLink.ForwardLink != NULL) {
    RemoveEntryList (&OFile->CheckLink);
    OFile->CheckLink.ForwardLink = NULL;
  }
  FatOFileFlush (OFile);
  if (!IsListEmpty (&OFile->Opens) || !IsListEmpty (&OFile->ChildHead)) {
    return FALSE;
  }
  FatCloseDirEnt (OFile->DirEnt);
  return TRUE;
}