/*++\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
VOID\r
);\r
\r
-BOOLEAN\r
-FatIsLocked (\r
+EFI_STATUS\r
+FatAcquireLockOrFail (\r
VOID\r
);\r
\r
/*++\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
// 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
// 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
/*++\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
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
\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