mirror of https://github.com/acidanthera/audk.git
Only traverse recovery file's FAT table to fast the recovery performance.
Signed-off-by: erictian Reviewed-by: niruiyu (based on FatPkg commit 6e68a62cf0c6b8ecad2bceff4e8d86ff08d1f041) [jordan.l.justen@intel.com: Use script to relicense to 2-clause BSD] Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Acked-by: Mark Doran <mark.doran@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
parent
4d0e0c4510
commit
1d951a3086
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
FAT file system access routines for FAT recovery PEIM
|
FAT file system access routines for FAT recovery PEIM
|
||||||
|
|
||||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials are licensed and made available
|
This program and the accompanying materials are licensed and made available
|
||||||
under the terms and conditions of the BSD License which accompanies this
|
under the terms and conditions of the BSD License which accompanies this
|
||||||
|
@ -315,7 +315,10 @@ FatSetFilePos (
|
||||||
}
|
}
|
||||||
|
|
||||||
File->CurrentPos += Pos;
|
File->CurrentPos += Pos;
|
||||||
|
//
|
||||||
|
// Calculate the amount of consecutive cluster occupied by the file.
|
||||||
|
// FatReadFile() will use it to read these blocks once.
|
||||||
|
//
|
||||||
File->StraightReadAmount = 0;
|
File->StraightReadAmount = 0;
|
||||||
Cluster = File->CurrentCluster;
|
Cluster = File->CurrentCluster;
|
||||||
while (!FAT_CLUSTER_FUNCTIONAL (Cluster)) {
|
while (!FAT_CLUSTER_FUNCTIONAL (Cluster)) {
|
||||||
|
@ -517,9 +520,6 @@ FatReadNextDirectoryEntry (
|
||||||
SubFile->StartingCluster = SubFile->CurrentCluster;
|
SubFile->StartingCluster = SubFile->CurrentCluster;
|
||||||
SubFile->Volume = ParentDir->Volume;
|
SubFile->Volume = ParentDir->Volume;
|
||||||
|
|
||||||
if (SubFile->StartingCluster != 0) {
|
|
||||||
Status = FatSetFilePos (PrivateData, SubFile, 0);
|
|
||||||
}
|
|
||||||
//
|
//
|
||||||
// in Pei phase, time parameters do not need to be filled for minimum use.
|
// in Pei phase, time parameters do not need to be filled for minimum use.
|
||||||
//
|
//
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
FAT recovery PEIM entry point, Ppi Functions and FAT Api functions.
|
FAT recovery PEIM entry point, Ppi Functions and FAT Api functions.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials are licensed and made available
|
This program and the accompanying materials are licensed and made available
|
||||||
under the terms and conditions of the BSD License which accompanies this
|
under the terms and conditions of the BSD License which accompanies this
|
||||||
|
@ -577,6 +577,7 @@ FindRecoveryFile (
|
||||||
//
|
//
|
||||||
// Construct root directory file
|
// Construct root directory file
|
||||||
//
|
//
|
||||||
|
ZeroMem (&Parent, sizeof (PEI_FAT_FILE));
|
||||||
Parent.IsFixedRootDir = (BOOLEAN) ((PrivateData->Volume[VolumeIndex].FatType == Fat32) ? FALSE : TRUE);
|
Parent.IsFixedRootDir = (BOOLEAN) ((PrivateData->Volume[VolumeIndex].FatType == Fat32) ? FALSE : TRUE);
|
||||||
Parent.Attributes = FAT_ATTR_DIRECTORY;
|
Parent.Attributes = FAT_ATTR_DIRECTORY;
|
||||||
Parent.CurrentPos = 0;
|
Parent.CurrentPos = 0;
|
||||||
|
@ -593,6 +594,9 @@ FindRecoveryFile (
|
||||||
//
|
//
|
||||||
Status = FatReadNextDirectoryEntry (PrivateData, &Parent, File);
|
Status = FatReadNextDirectoryEntry (PrivateData, &Parent, File);
|
||||||
while (Status == EFI_SUCCESS) {
|
while (Status == EFI_SUCCESS) {
|
||||||
|
//
|
||||||
|
// Compare whether the file name is recovery file name.
|
||||||
|
//
|
||||||
if (EngStriColl (PrivateData, FileName, File->FileName)) {
|
if (EngStriColl (PrivateData, FileName, File->FileName)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -604,6 +608,13 @@ FindRecoveryFile (
|
||||||
return EFI_NOT_FOUND;
|
return EFI_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Get the recovery file, set its file position to 0.
|
||||||
|
//
|
||||||
|
if (File->StartingCluster != 0) {
|
||||||
|
Status = FatSetFilePos (PrivateData, File, 0);
|
||||||
|
}
|
||||||
|
|
||||||
*Handle = File;
|
*Handle = File;
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
|
|
Loading…
Reference in New Issue