-/*++\r
+/** @file\r
+ Functions for performing directory entry io.\r
\r
Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>\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
-distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+**/\r
\r
+#include "Fat.h"\r
\r
-Module Name:\r
-\r
- DirectoryManage.c\r
-\r
-Abstract:\r
-\r
- Functions for performing directory entry io\r
+/**\r
\r
-Revision History\r
+ Get a directory entry from disk for the Ofile.\r
\r
---*/\r
+ @param Parent - The parent of the OFile which need to update.\r
+ @param IoMode - Indicate whether to read directory entry or write directroy entry.\r
+ @param EntryPos - The position of the directory entry to be accessed.\r
+ @param Entry - The directory entry read or written.\r
\r
-#include "Fat.h"\r
+ @retval EFI_SUCCESS - Access the directory entry sucessfully.\r
+ @return other - An error occurred when reading the directory entry.\r
\r
+**/\r
STATIC\r
EFI_STATUS\r
FatAccessEntry (\r
IN UINTN EntryPos,\r
IN OUT VOID *Entry\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Get a directory entry from disk for the Ofile.\r
-\r
-Arguments:\r
-\r
- Parent - The parent of the OFile which need to update.\r
- IoMode - Indicate whether to read directory entry or write directroy entry.\r
- EntryPos - The position of the directory entry to be accessed.\r
- Entry - The directory entry read or written.\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - Access the directory entry sucessfully.\r
- other - An error occurred when reading the directory entry.\r
-\r
---*/\r
{\r
UINTN Position;\r
UINTN BufferSize;\r
return FatAccessOFile (Parent, IoMode, Position, &BufferSize, Entry, NULL);\r
}\r
\r
-EFI_STATUS\r
-FatStoreDirEnt (\r
- IN FAT_OFILE *OFile,\r
- IN FAT_DIRENT *DirEnt\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
\r
Save the directory entry to disk.\r
\r
-Arguments:\r
-\r
- OFile - The parent OFile which needs to update.\r
- DirEnt - The directory entry to be saved.\r
+ @param OFile - The parent OFile which needs to update.\r
+ @param DirEnt - The directory entry to be saved.\r
\r
-Returns:\r
+ @retval EFI_SUCCESS - Store the directory entry successfully.\r
+ @return other - An error occurred when writing the directory entry.\r
\r
- EFI_SUCCESS - Store the directory entry successfully.\r
- other - An error occurred when writing the directory entry.\r
-\r
---*/\r
+**/\r
+EFI_STATUS\r
+FatStoreDirEnt (\r
+ IN FAT_OFILE *OFile,\r
+ IN FAT_DIRENT *DirEnt\r
+ )\r
{\r
EFI_STATUS Status;\r
FAT_DIRECTORY_LFN LfnEntry;\r
return EFI_SUCCESS;\r
}\r
\r
-BOOLEAN\r
-FatIsDotDirEnt (\r
- IN FAT_DIRENT *DirEnt\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
\r
Determine whether the directory entry is "." or ".." entry.\r
\r
-Arguments:\r
-\r
- DirEnt - The corresponding directory entry.\r
-\r
-Returns:\r
+ @param DirEnt - The corresponding directory entry.\r
\r
- TRUE - The directory entry is "." or ".." directory entry\r
- FALSE - The directory entry is not "." or ".." directory entry\r
+ @retval TRUE - The directory entry is "." or ".." directory entry\r
+ @retval FALSE - The directory entry is not "." or ".." directory entry\r
\r
---*/\r
+**/\r
+BOOLEAN\r
+FatIsDotDirEnt (\r
+ IN FAT_DIRENT *DirEnt\r
+ )\r
{\r
CHAR16 *FileString;\r
FileString = DirEnt->FileString;\r
return FALSE;\r
}\r
\r
+/**\r
+\r
+ Set the OFile's cluster info in its directory entry.\r
+\r
+ @param OFile - The corresponding OFile.\r
+\r
+**/\r
STATIC\r
VOID\r
FatSetDirEntCluster (\r
IN FAT_OFILE *OFile\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Set the OFile's cluster info in its directory entry.\r
-\r
-Arguments:\r
-\r
- OFile - The corresponding OFile.\r
-\r
-Returns:\r
-\r
- None.\r
-\r
---*/\r
{\r
UINTN Cluster;\r
FAT_DIRENT *DirEnt;\r
DirEnt->Entry.FileCluster = (UINT16) Cluster;\r
}\r
\r
-VOID\r
-FatUpdateDirEntClusterSizeInfo (\r
- IN FAT_OFILE *OFile\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
\r
Set the OFile's cluster and size info in its directory entry.\r
\r
-Arguments:\r
-\r
- OFile - The corresponding OFile.\r
-\r
-Returns:\r
+ @param OFile - The corresponding OFile.\r
\r
- None.\r
-\r
---*/\r
+**/\r
+VOID\r
+FatUpdateDirEntClusterSizeInfo (\r
+ IN FAT_OFILE *OFile\r
+ )\r
{\r
ASSERT (OFile->ODir == NULL);\r
OFile->DirEnt->Entry.FileSize = (UINT32) OFile->FileSize;\r
FatSetDirEntCluster (OFile);\r
}\r
\r
+/**\r
+\r
+ Copy all the information of DirEnt2 to DirEnt1 except for 8.3 name.\r
+\r
+ @param DirEnt1 - The destination directory entry.\r
+ @param DirEnt2 - The source directory entry.\r
+\r
+**/\r
VOID\r
FatCloneDirEnt (\r
IN FAT_DIRENT *DirEnt1,\r
IN FAT_DIRENT *DirEnt2\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Copy all the information of DirEnt2 to DirEnt1 except for 8.3 name.\r
-\r
-Arguments:\r
-\r
- DirEnt1 - The destination directory entry.\r
- DirEnt2 - The source directory entry.\r
-\r
-Returns:\r
-\r
- None.\r
-\r
---*/\r
{\r
UINT8 *Entry1;\r
UINT8 *Entry2;\r
);\r
}\r
\r
+/**\r
+\r
+ Get the LFN for the directory entry.\r
+\r
+ @param Parent - The parent directory.\r
+ @param DirEnt - The directory entry to get LFN.\r
+\r
+**/\r
STATIC\r
VOID\r
FatLoadLongNameEntry (\r
IN FAT_OFILE *Parent,\r
IN FAT_DIRENT *DirEnt\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Get the LFN for the directory entry.\r
-\r
-Arguments:\r
-\r
- Parent - The parent directory.\r
- DirEnt - The directory entry to get LFN.\r
-\r
-Returns:\r
-\r
- None.\r
-\r
---*/\r
{\r
CHAR16 LfnBuffer[MAX_LFN_ENTRIES * LFN_CHAR_TOTAL + 1];\r
CHAR16 *LfnBufferPointer;\r
DirEnt->FileString = AllocateCopyPool (StrSize (LfnBuffer), LfnBuffer);\r
}\r
\r
+/**\r
+\r
+ Add this directory entry node to the list of directory entries and hash table.\r
+\r
+ @param ODir - The parent OFile which needs to be updated.\r
+ @param DirEnt - The directory entry to be added.\r
+\r
+**/\r
STATIC\r
VOID\r
FatAddDirEnt (\r
IN FAT_ODIR *ODir,\r
IN FAT_DIRENT *DirEnt\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Add this directory entry node to the list of directory entries and hash table.\r
-\r
-Arguments:\r
-\r
- ODir - The parent OFile which needs to be updated.\r
- DirEnt - The directory entry to be added.\r
-\r
-Returns:\r
-\r
- None.\r
-\r
---*/\r
{\r
if (DirEnt->Link.BackLink == NULL) {\r
DirEnt->Link.BackLink = &ODir->ChildList;\r
FatInsertToHashTable (ODir, DirEnt);\r
}\r
\r
+/**\r
+\r
+ Load from disk the next directory entry at current end of directory position.\r
+\r
+ @param OFile - The parent OFile.\r
+ @param PtrDirEnt - The directory entry that is loaded.\r
+\r
+ @retval EFI_SUCCESS - Load the directory entry successfully.\r
+ @retval EFI_OUT_OF_RESOURCES - Out of resource.\r
+ @return other - An error occurred when reading the directory entries.\r
+\r
+**/\r
STATIC\r
EFI_STATUS\r
FatLoadNextDirEnt (\r
IN FAT_OFILE *OFile,\r
OUT FAT_DIRENT **PtrDirEnt\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Load from disk the next directory entry at current end of directory position\r
-\r
-Arguments:\r
-\r
- OFile - The parent OFile.\r
- PtrDirEnt - The directory entry that is loaded.\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - Load the directory entry successfully.\r
- EFI_OUT_OF_RESOURCES - Out of resource.\r
- other - An error occurred when reading the directory entries.\r
-\r
---*/\r
{\r
EFI_STATUS Status;\r
FAT_DIRENT *DirEnt;\r
return Status;\r
}\r
\r
+/**\r
+\r
+ Get the directory entry's info into Buffer.\r
+\r
+ @param Volume - FAT file system volume.\r
+ @param DirEnt - The corresponding directory entry.\r
+ @param BufferSize - Size of Buffer.\r
+ @param Buffer - Buffer containing file info.\r
+\r
+ @retval EFI_SUCCESS - Get the file info successfully.\r
+ @retval EFI_BUFFER_TOO_SMALL - The buffer is too small.\r
+\r
+**/\r
EFI_STATUS\r
FatGetDirEntInfo (\r
IN FAT_VOLUME *Volume,\r
IN OUT UINTN *BufferSize,\r
OUT VOID *Buffer\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Get the directory entry's info into Buffer.\r
-\r
-Arguments:\r
-\r
- Volume - FAT file system volume.\r
- DirEnt - The corresponding directory entry.\r
- BufferSize - Size of Buffer.\r
- Buffer - Buffer containing file info.\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - Get the file info successfully.\r
- EFI_BUFFER_TOO_SMALL - The buffer is too small.\r
-\r
---*/\r
{\r
UINTN Size;\r
UINTN NameSize;\r
return Status;\r
}\r
\r
+/**\r
+\r
+ Search the directory for the directory entry whose filename is FileNameString.\r
+\r
+ @param OFile - The parent OFile whose directory is to be searched.\r
+ @param FileNameString - The filename to be searched.\r
+ @param PtrDirEnt - pointer to the directory entry if found.\r
+\r
+ @retval EFI_SUCCESS - Find the directory entry or not found.\r
+ @return other - An error occurred when reading the directory entries.\r
+\r
+**/\r
STATIC\r
EFI_STATUS\r
FatSearchODir (\r
IN CHAR16 *FileNameString,\r
OUT FAT_DIRENT **PtrDirEnt\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Search the directory for the directory entry whose filename is FileNameString.\r
-\r
-Arguments:\r
-\r
- OFile - The parent OFile whose directory is to be searched.\r
- FileNameString - The filename to be searched.\r
- PtrDirEnt - pointer to the directory entry if found.\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - Find the directory entry or not found.\r
- other - An error occurred when reading the directory entries.\r
-\r
---*/\r
{\r
BOOLEAN PossibleShortName;\r
CHAR8 File8Dot3Name[FAT_NAME_LEN];\r
return EFI_SUCCESS;\r
}\r
\r
-VOID\r
-FatResetODirCursor (\r
- IN FAT_OFILE *OFile\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
\r
Set the OFile's current directory cursor to the list head.\r
\r
-Arguments:\r
-\r
- OFile - The directory OFile whose directory cursor is reset.\r
-\r
-Returns:\r
+ @param OFile - The directory OFile whose directory cursor is reset.\r
\r
- None.\r
-\r
---*/\r
+**/\r
+VOID\r
+FatResetODirCursor (\r
+ IN FAT_OFILE *OFile\r
+ )\r
{\r
FAT_ODIR *ODir;\r
\r
ODir->CurrentPos = 0;\r
}\r
\r
-EFI_STATUS\r
-FatGetNextDirEnt (\r
- IN FAT_OFILE *OFile,\r
- OUT FAT_DIRENT **PtrDirEnt\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
\r
Set the directory's cursor to the next and get the next directory entry.\r
\r
-Arguments:\r
-\r
- OFile - The parent OFile.\r
- PtrDirEnt - The next directory entry.\r
+ @param OFile - The parent OFile.\r
+ @param PtrDirEnt - The next directory entry.\r
\r
-Returns:\r
+ @retval EFI_SUCCESS - We get the next directory entry successfully.\r
+ @return other - An error occurred when get next directory entry.\r
\r
- EFI_SUCCESS - We get the next directory entry successfully.\r
- other - An error occurred when get next directory entry.\r
-\r
---*/\r
+**/\r
+EFI_STATUS\r
+FatGetNextDirEnt (\r
+ IN FAT_OFILE *OFile,\r
+ OUT FAT_DIRENT **PtrDirEnt\r
+ )\r
{\r
EFI_STATUS Status;\r
FAT_DIRENT *DirEnt;\r
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+\r
+ Set the directory entry count according to the filename.\r
+\r
+ @param OFile - The corresponding OFile.\r
+ @param DirEnt - The directory entry to be set.\r
+\r
+**/\r
STATIC\r
VOID\r
FatSetEntryCount (\r
IN FAT_OFILE *OFile,\r
IN FAT_DIRENT *DirEnt\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Set the directory entry count according to the filename.\r
-\r
-Arguments:\r
-\r
- OFile - The corresponding OFile.\r
- DirEnt - The directory entry to be set.\r
-\r
-Returns:\r
-\r
- None.\r
-\r
---*/\r
{\r
CHAR16 *FileString;\r
CHAR8 *File8Dot3Name;\r
}\r
}\r
\r
+/**\r
+\r
+ Append a zero cluster to the current OFile.\r
+\r
+ @param OFile - The directory OFile which needs to be updated.\r
+\r
+ @retval EFI_SUCCESS - Append a zero cluster to the OFile successfully.\r
+ @return other - An error occurred when appending the zero cluster.\r
+\r
+**/\r
STATIC\r
EFI_STATUS\r
FatExpandODir (\r
IN FAT_OFILE *OFile\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Append a zero cluster to the current OFile.\r
+{\r
+ return FatExpandOFile (OFile, OFile->FileSize + OFile->Volume->ClusterSize);\r
+}\r
\r
-Arguments:\r
+/**\r
\r
- OFile - The directory OFile which needs to be updated.\r
+ Search the Root OFile for the possible volume label.\r
\r
-Returns:\r
+ @param Root - The Root OFile.\r
+ @param DirEnt - The returned directory entry of volume label.\r
\r
- EFI_SUCCESS - Append a zero cluster to the OFile successfully.\r
- other - An error occurred when appending the zero cluster.\r
-\r
---*/\r
-{\r
- return FatExpandOFile (OFile, OFile->FileSize + OFile->Volume->ClusterSize);\r
-}\r
+ @retval EFI_SUCCESS - The search process is completed successfully.\r
+ @return other - An error occurred when searching volume label.\r
\r
+**/\r
STATIC\r
EFI_STATUS\r
FatSeekVolumeId (\r
IN FAT_OFILE *Root,\r
OUT FAT_DIRENT *DirEnt\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Search the Root OFile for the possible volume label.\r
-\r
-Arguments:\r
-\r
- Root - The Root OFile.\r
- DirEnt - The returned directory entry of volume label.\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - The search process is completed successfully.\r
- other - An error occurred when searching volume label.\r
-\r
---*/\r
{\r
EFI_STATUS Status;\r
UINTN EntryPos;\r
return EFI_SUCCESS;\r
}\r
\r
-STATIC\r
-EFI_STATUS\r
-FatFirstFitInsertDirEnt (\r
- IN FAT_OFILE *OFile,\r
- IN FAT_DIRENT *DirEnt\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
\r
Use First Fit Algorithm to insert directory entry.\r
Only this function will erase "E5" entries in a directory.\r
In view of safest recovery, this function will only be triggered\r
when maximum directory entry number has reached.\r
\r
-Arguments:\r
-\r
- OFile - The corresponding OFile.\r
- DirEnt - The directory entry to be inserted.\r
-\r
-Returns:\r
+ @param OFile - The corresponding OFile.\r
+ @param DirEnt - The directory entry to be inserted.\r
\r
- EFI_SUCCESS - The directory entry has been successfully inserted.\r
- EFI_VOLUME_FULL - The directory can not hold more directory entries.\r
- Others - Some error occurred when inserting new directory entries.\r
+ @retval EFI_SUCCESS - The directory entry has been successfully inserted.\r
+ @retval EFI_VOLUME_FULL - The directory can not hold more directory entries.\r
+ @return Others - Some error occurred when inserting new directory entries.\r
\r
---*/\r
+**/\r
+STATIC\r
+EFI_STATUS\r
+FatFirstFitInsertDirEnt (\r
+ IN FAT_OFILE *OFile,\r
+ IN FAT_DIRENT *DirEnt\r
+ )\r
{\r
EFI_STATUS Status;\r
FAT_ODIR *ODir;\r
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+\r
+ Find the new directory entry position for the directory entry.\r
+\r
+ @param OFile - The corresponding OFile.\r
+ @param DirEnt - The directory entry whose new position is to be set.\r
+\r
+ @retval EFI_SUCCESS - The new directory entry position is successfully found.\r
+ @retval EFI_VOLUME_FULL - The directory has reach its maximum capacity.\r
+ @return other - An error occurred when reading the directory entry.\r
+\r
+**/\r
STATIC\r
EFI_STATUS\r
FatNewEntryPos (\r
IN FAT_OFILE *OFile,\r
IN FAT_DIRENT *DirEnt\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Find the new directory entry position for the directory entry.\r
-\r
-Arguments:\r
-\r
- OFile - The corresponding OFile.\r
- DirEnt - The directory entry whose new position is to be set.\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - The new directory entry position is successfully found.\r
- EFI_VOLUME_FULL - The directory has reach its maximum capacity.\r
- other - An error occurred when reading the directory entry.\r
-\r
---*/\r
{\r
EFI_STATUS Status;\r
FAT_ODIR *ODir;\r
return EFI_SUCCESS;\r
}\r
\r
-EFI_STATUS\r
-FatGetVolumeEntry (\r
- IN FAT_VOLUME *Volume,\r
- IN CHAR16 *Name\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
\r
Get the directory entry for the volume.\r
\r
-Arguments:\r
-\r
- Volume - FAT file system volume.\r
- Name - The file name of the volume.\r
+ @param Volume - FAT file system volume.\r
+ @param Name - The file name of the volume.\r
\r
-Returns:\r
+ @retval EFI_SUCCESS - Update the volume with the directory entry sucessfully.\r
+ @return others - An error occurred when getting volume label.\r
\r
- EFI_SUCCESS - Update the volume with the directory entry sucessfully.\r
- others - An error occurred when getting volume label.\r
-\r
---*/\r
+**/\r
+EFI_STATUS\r
+FatGetVolumeEntry (\r
+ IN FAT_VOLUME *Volume,\r
+ IN CHAR16 *Name\r
+ )\r
{\r
EFI_STATUS Status;\r
FAT_DIRENT LabelDirEnt;\r
return Status;\r
}\r
\r
-EFI_STATUS\r
-FatSetVolumeEntry (\r
- IN FAT_VOLUME *Volume,\r
- IN CHAR16 *Name\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
\r
Set the relevant directory entry into disk for the volume.\r
\r
-Arguments:\r
-\r
- Volume - FAT file system volume.\r
- Name - The new file name of the volume.\r
+ @param Volume - FAT file system volume.\r
+ @param Name - The new file name of the volume.\r
\r
-Returns:\r
+ @retval EFI_SUCCESS - Update the Volume sucessfully.\r
+ @retval EFI_UNSUPPORTED - The input label is not a valid volume label.\r
+ @return other - An error occurred when setting volume label.\r
\r
- EFI_SUCCESS - Update the Volume sucessfully.\r
- EFI_UNSUPPORTED - The input label is not a valid volume label.\r
- other - An error occurred when setting volume label.\r
-\r
---*/\r
+**/\r
+EFI_STATUS\r
+FatSetVolumeEntry (\r
+ IN FAT_VOLUME *Volume,\r
+ IN CHAR16 *Name\r
+ )\r
{\r
EFI_STATUS Status;\r
FAT_DIRENT LabelDirEnt;\r
return FatStoreDirEnt (Root, &LabelDirEnt);\r
}\r
\r
-EFI_STATUS\r
-FatCreateDotDirEnts (\r
- IN FAT_OFILE *OFile\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
\r
Create "." and ".." directory entries in the newly-created parent OFile.\r
\r
-Arguments:\r
-\r
- OFile - The parent OFile.\r
-\r
-Returns:\r
+ @param OFile - The parent OFile.\r
\r
- EFI_SUCCESS - The dot directory entries are successfully created.\r
- other - An error occurred when creating the directory entry.\r
+ @retval EFI_SUCCESS - The dot directory entries are successfully created.\r
+ @return other - An error occurred when creating the directory entry.\r
\r
---*/\r
+**/\r
+EFI_STATUS\r
+FatCreateDotDirEnts (\r
+ IN FAT_OFILE *OFile\r
+ )\r
{\r
EFI_STATUS Status;\r
FAT_DIRENT *DirEnt;\r
return Status;\r
}\r
\r
+/**\r
+\r
+ Create a directory entry in the parent OFile.\r
+\r
+ @param OFile - The parent OFile.\r
+ @param FileName - The filename of the newly-created directory entry.\r
+ @param Attributes - The attribute of the newly-created directory entry.\r
+ @param PtrDirEnt - The pointer to the newly-created directory entry.\r
+\r
+ @retval EFI_SUCCESS - The directory entry is successfully created.\r
+ @retval EFI_OUT_OF_RESOURCES - Not enough memory to create the directory entry.\r
+ @return other - An error occurred when creating the directory entry.\r
+\r
+**/\r
EFI_STATUS\r
FatCreateDirEnt (\r
IN FAT_OFILE *OFile,\r
IN UINT8 Attributes,\r
OUT FAT_DIRENT **PtrDirEnt\r
)\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Create a directory entry in the parent OFile.\r
-\r
-Arguments:\r
-\r
- OFile - The parent OFile.\r
- FileName - The filename of the newly-created directory entry.\r
- Attributes - The attribute of the newly-created directory entry.\r
- PtrDirEnt - The pointer to the newly-created directory entry.\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - The directory entry is successfully created.\r
- EFI_OUT_OF_RESOURCES - Not enough memory to create the directory entry.\r
- other - An error occurred when creating the directory entry.\r
-\r
---*/\r
{\r
FAT_DIRENT *DirEnt;\r
FAT_ODIR *ODir;\r
return Status;\r
}\r
\r
-EFI_STATUS\r
-FatRemoveDirEnt (\r
- IN FAT_OFILE *OFile,\r
- IN FAT_DIRENT *DirEnt\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
\r
Remove this directory entry node from the list of directory entries and hash table.\r
\r
-Arguments:\r
-\r
- OFile - The parent OFile.\r
- DirEnt - The directory entry to be removed.\r
-\r
-Returns:\r
+ @param OFile - The parent OFile.\r
+ @param DirEnt - The directory entry to be removed.\r
\r
- EFI_SUCCESS - The directory entry is successfully removed.\r
- other - An error occurred when removing the directory entry.\r
+ @retval EFI_SUCCESS - The directory entry is successfully removed.\r
+ @return other - An error occurred when removing the directory entry.\r
\r
---*/\r
+**/\r
+EFI_STATUS\r
+FatRemoveDirEnt (\r
+ IN FAT_OFILE *OFile,\r
+ IN FAT_DIRENT *DirEnt\r
+ )\r
{\r
FAT_ODIR *ODir;\r
\r
return FatStoreDirEnt (OFile, DirEnt);\r
}\r
\r
-EFI_STATUS\r
-FatOpenDirEnt (\r
- IN FAT_OFILE *Parent,\r
- IN FAT_DIRENT *DirEnt\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
\r
Open the directory entry to get the OFile.\r
\r
-Arguments:\r
+ @param Parent - The parent OFile.\r
+ @param DirEnt - The directory entry to be opened.\r
\r
- OFile - The parent OFile.\r
- DirEnt - The directory entry to be opened.\r
+ @retval EFI_SUCCESS - The directory entry is successfully opened.\r
+ @retval EFI_OUT_OF_RESOURCES - not enough memory to allocate a new OFile.\r
+ @return other - An error occurred when opening the directory entry.\r
\r
-Returns:\r
-\r
- EFI_SUCCESS - The directory entry is successfully opened.\r
- EFI_OUT_OF_RESOURCES - not enough memory to allocate a new OFile.\r
- other - An error occurred when opening the directory entry.\r
-\r
---*/\r
+**/\r
+EFI_STATUS\r
+FatOpenDirEnt (\r
+ IN FAT_OFILE *Parent,\r
+ IN FAT_DIRENT *DirEnt\r
+ )\r
{\r
FAT_OFILE *OFile;\r
FAT_VOLUME *Volume;\r
return EFI_SUCCESS;\r
}\r
\r
-VOID\r
-FatCloseDirEnt (\r
- IN FAT_DIRENT *DirEnt\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
\r
Close the directory entry and free the OFile.\r
\r
-Arguments:\r
-\r
- DirEnt - The directory entry to be closed.\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - The directory entry is successfully opened.\r
- Other - An error occurred when opening the directory entry.\r
+ @param DirEnt - The directory entry to be closed.\r
\r
---*/\r
+**/\r
+VOID\r
+FatCloseDirEnt (\r
+ IN FAT_DIRENT *DirEnt\r
+ )\r
{\r
FAT_OFILE *OFile;\r
FAT_VOLUME *Volume;\r
}\r
}\r
\r
-EFI_STATUS\r
-FatLocateOFile (\r
- IN OUT FAT_OFILE **PtrOFile,\r
- IN CHAR16 *FileName,\r
- IN UINT8 Attributes,\r
- OUT CHAR16 *NewFileName\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
\r
Traverse filename and open all OFiles that can be opened.\r
Update filename pointer to the component that can't be opened.\r
If more than one name component remains, returns an error;\r
otherwise, return the remaining name component so that the caller might choose to create it.\r
\r
-Arguments:\r
- PtrOFile - As input, the reference OFile; as output, the located OFile.\r
- FileName - The file name relevant to the OFile.\r
- Attributes - The attribute of the destination OFile.\r
- NewFileName - The remaining file name.\r
-\r
-Returns:\r
+ @param PtrOFile - As input, the reference OFile; as output, the located OFile.\r
+ @param FileName - The file name relevant to the OFile.\r
+ @param Attributes - The attribute of the destination OFile.\r
+ @param NewFileName - The remaining file name.\r
\r
- EFI_NOT_FOUND - The file name can't be opened and there is more than one\r
+ @retval EFI_NOT_FOUND - The file name can't be opened and there is more than one\r
components within the name left (this means the name can\r
not be created either).\r
- EFI_INVALID_PARAMETER - The parameter is not valid.\r
- EFI_SUCCESS - Open the file successfully.\r
- other - An error occured when locating the OFile.\r
+ @retval EFI_INVALID_PARAMETER - The parameter is not valid.\r
+ @retval EFI_SUCCESS - Open the file successfully.\r
+ @return other - An error occured when locating the OFile.\r
\r
---*/\r
+**/\r
+EFI_STATUS\r
+FatLocateOFile (\r
+ IN OUT FAT_OFILE **PtrOFile,\r
+ IN CHAR16 *FileName,\r
+ IN UINT8 Attributes,\r
+ OUT CHAR16 *NewFileName\r
+ )\r
{\r
EFI_STATUS Status;\r
FAT_VOLUME *Volume;\r