]> git.proxmox.com Git - mirror_edk2.git/blobdiff - FatPkg/EnhancedFatDxe/Misc.c
Fix a migration bug in Fat driver as the value of lock has been changed from EDK...
[mirror_edk2.git] / FatPkg / EnhancedFatDxe / Misc.c
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