]> git.proxmox.com Git - mirror_edk2.git/blobdiff - FatPkg/FatPei/FatLiteAccess.c
InterFsp2Pkg:Tool: Add user manual for SplitFspBin tool.
[mirror_edk2.git] / FatPkg / FatPei / FatLiteAccess.c
index 0a688a3185e6971779cd9b5dfd2269ea84978f90..110634508bf497905c261da81f7dc77e3019ce14 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 - 2013, 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
@@ -472,7 +475,7 @@ FatReadNextDirectoryEntry (
     // We only search for *FILE* in root directory\r
     // Long file name entry is *NOT* supported\r
     //\r
-    if ((DirEntry.Attributes == FAT_ATTR_DIRECTORY) || (DirEntry.Attributes == FAT_ATTR_LFN)) {\r
+    if (((DirEntry.Attributes & FAT_ATTR_DIRECTORY) == FAT_ATTR_DIRECTORY) || (DirEntry.Attributes == FAT_ATTR_LFN)) {\r
       continue;\r
     }\r
     //\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