/** @file\r
FAT file system access routines for FAT recovery PEIM\r
\r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials are licensed and made available\r
under the terms and conditions of the BSD License which accompanies this\r
}\r
\r
File->CurrentPos += Pos;\r
-\r
+ //\r
+ // Calculate the amount of consecutive cluster occupied by the file.\r
+ // FatReadFile() will use it to read these blocks once.\r
+ //\r
File->StraightReadAmount = 0;\r
Cluster = File->CurrentCluster;\r
while (!FAT_CLUSTER_FUNCTIONAL (Cluster)) {\r
SubFile->StartingCluster = SubFile->CurrentCluster;\r
SubFile->Volume = ParentDir->Volume;\r
\r
- if (SubFile->StartingCluster != 0) {\r
- Status = FatSetFilePos (PrivateData, SubFile, 0);\r
- }\r
//\r
// in Pei phase, time parameters do not need to be filled for minimum use.\r
//\r
/** @file\r
FAT recovery PEIM entry point, Ppi Functions and FAT Api functions.\r
\r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials are licensed and made available\r
under the terms and conditions of the BSD License which accompanies this\r
//\r
// Construct root directory file\r
//\r
+ ZeroMem (&Parent, sizeof (PEI_FAT_FILE));\r
Parent.IsFixedRootDir = (BOOLEAN) ((PrivateData->Volume[VolumeIndex].FatType == Fat32) ? FALSE : TRUE);\r
Parent.Attributes = FAT_ATTR_DIRECTORY;\r
Parent.CurrentPos = 0;\r
//\r
Status = FatReadNextDirectoryEntry (PrivateData, &Parent, File);\r
while (Status == EFI_SUCCESS) {\r
+ //\r
+ // Compare whether the file name is recovery file name.\r
+ //\r
if (EngStriColl (PrivateData, FileName, File->FileName)) {\r
break;\r
}\r
return EFI_NOT_FOUND;\r
}\r
\r
+ //\r
+ // Get the recovery file, set its file position to 0.\r
+ //\r
+ if (File->StartingCluster != 0) {\r
+ Status = FatSetFilePos (PrivateData, File, 0);\r
+ }\r
+\r
*Handle = File;\r
\r
return EFI_SUCCESS;\r