]> git.proxmox.com Git - mirror_edk2.git/blobdiff - FatPkg/EnhancedFatDxe/Init.c
Fix a migration bug in Fat driver as the value of lock has been changed from EDK...
[mirror_edk2.git] / FatPkg / EnhancedFatDxe / Init.c
index b0e34d18cd005cbb16f42e102f071557dd262c0b..e18ff54474750303f3f953132b379b1ae67c674f 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2005 - 2007, Intel Corporation\r
+Copyright (c) 2005 - 2010, Intel Corporation\r
 All rights reserved. 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
 distribution. The full text of the license may be found at\r
@@ -64,8 +64,8 @@ Returns:
   // Acquire the lock.\r
   // If caller has already acquired the lock, cannot lock it again.\r
   //\r
-  if (!FatIsLocked ()) {\r
-    FatAcquireLock ();\r
+  Status = FatAcquireLockOrFail ();\r
+  if (!EFI_ERROR (Status)) {\r
     LockedByMe = TRUE;\r
   }\r
   //\r
@@ -180,9 +180,9 @@ Returns:
   // means we are in the process of some Fat operation),\r
   // we can not acquire again.\r
   //\r
-  if (!FatIsLocked ()) {\r
+  Status = FatAcquireLockOrFail ();\r
+  if (!EFI_ERROR (Status)) {\r
     LockedByMe = TRUE;\r
-    FatAcquireLock ();\r
   }\r
   //\r
   // The volume is still being used. Hence, set error flag for all OFiles still in\r