]> git.proxmox.com Git - mirror_edk2.git/blobdiff - FatPkg/FatPei/FatLiteAccess.c
Only traverse recovery file's FAT table to fast the recovery performance.
[mirror_edk2.git] / FatPkg / FatPei / FatLiteAccess.c
index 0a688a3185e6971779cd9b5dfd2269ea84978f90..53f5e3f60cbbc118c01846b66fc99e9ea43257bb 100644 (file)
@@ -1,7 +1,7 @@
 /** @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
@@ -315,7 +315,10 @@ FatSetFilePos (
     }\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
@@ -517,9 +520,6 @@ FatReadNextDirectoryEntry (
   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