]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix a migration bug in Fat driver as the value of lock has been changed from EDK...
authorQing Huang <qing.huang@intel.com>
Thu, 18 Mar 2010 01:56:21 +0000 (01:56 +0000)
committerJordan Justen <jordan.l.justen@intel.com>
Thu, 7 Apr 2016 06:22:43 +0000 (23:22 -0700)
(based on FatPkg commit c243d2ce08e76bfaefc0a3e9256603993a3b5ebe)

[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>
FatPkg/EnhancedFatDxe/Fat.h
FatPkg/EnhancedFatDxe/Init.c
FatPkg/EnhancedFatDxe/Misc.c

index 56822f723a56b023183458f7a6122cd1a7e9e913..1b1d42463790d34eef346a37f1660b05eef12d5e 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2005 - 2009, 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
@@ -783,8 +783,8 @@ FatReleaseLock (
   VOID\r
   );\r
 \r
-BOOLEAN\r
-FatIsLocked (\r
+EFI_STATUS\r
+FatAcquireLockOrFail (\r
   VOID\r
   );\r
 \r
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
index a06914fd190d3a0325bb45924c0503ead8f132c4..8774ac8c115b8726fbd6545a0bb53a4bbf40e742 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2005, 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
@@ -140,15 +140,17 @@ Returns:
   EfiAcquireLock (&FatFsLock);\r
 }\r
 \r
-BOOLEAN\r
-FatIsLocked (\r
+EFI_STATUS\r
+FatAcquireLockOrFail (\r
   VOID\r
   )\r
 /*++\r
 \r
 Routine Description:\r
 \r
-  Get the locking status of the volume.\r
+  Lock the volume.\r
+  If the lock is already in the acquired state, then EFI_ACCESS_DENIED is returned.\r
+  Otherwise, EFI_SUCCESS is returned.\r
 \r
 Arguments:\r
 \r
@@ -156,12 +158,12 @@ Arguments:
 \r
 Returns:\r
 \r
-  TRUE                  - The volume is locked.\r
-  FALSE                 - The volume is not locked.\r
+  EFI_SUCCESS           - The volume is locked.\r
+  EFI_ACCESS_DENIED     - The volume could not be locked because it is already locked.\r
 \r
 --*/\r
 {\r
-  return (BOOLEAN) (FatFsLock.Lock);\r
+  return EfiAcquireLockOrFail (&FatFsLock);\r
 }\r
 \r
 VOID\r