TianoCore EDK2 master
|
#include "Fat.h"
Go to the source code of this file.
Functions for performing directory entry io.
Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file DirectoryManage.c.
STATIC EFI_STATUS FatAccessEntry | ( | IN FAT_OFILE * | Parent, |
IN IO_MODE | IoMode, | ||
IN UINTN | EntryPos, | ||
IN OUT VOID * | Entry | ||
) |
Get a directory entry from disk for the Ofile.
Parent | - The parent of the OFile which need to update. |
IoMode | - Indicate whether to read directory entry or write directory entry. |
EntryPos | - The position of the directory entry to be accessed. |
Entry | - The directory entry read or written. |
EFI_SUCCESS | - Access the directory entry successfully. |
Definition at line 26 of file DirectoryManage.c.
STATIC VOID FatAddDirEnt | ( | IN FAT_ODIR * | ODir, |
IN FAT_DIRENT * | DirEnt | ||
) |
Add this directory entry node to the list of directory entries and hash table.
ODir | - The parent OFile which needs to be updated. |
DirEnt | - The directory entry to be added. |
Definition at line 318 of file DirectoryManage.c.
VOID FatCloneDirEnt | ( | IN FAT_DIRENT * | DirEnt1, |
IN FAT_DIRENT * | DirEnt2 | ||
) |
Copy all the information of DirEnt2 to DirEnt1 except for 8.3 name.
DirEnt1 | - The destination directory entry. |
DirEnt2 | - The source directory entry. |
Definition at line 205 of file DirectoryManage.c.
VOID FatCloseDirEnt | ( | IN FAT_DIRENT * | DirEnt | ) |
Close the directory entry and free the OFile.
DirEnt | - The directory entry to be closed. |
Definition at line 1216 of file DirectoryManage.c.
EFI_STATUS FatCreateDirEnt | ( | IN FAT_OFILE * | OFile, |
IN CHAR16 * | FileName, | ||
IN UINT8 | Attributes, | ||
OUT FAT_DIRENT ** | PtrDirEnt | ||
) |
Create a directory entry in the parent OFile.
OFile | - The parent OFile. |
FileName | - The filename of the newly-created directory entry. |
Attributes | - The attribute of the newly-created directory entry. |
PtrDirEnt | - The pointer to the newly-created directory entry. |
EFI_SUCCESS | - The directory entry is successfully created. |
EFI_OUT_OF_RESOURCES | - Not enough memory to create the directory entry. |
Definition at line 1040 of file DirectoryManage.c.
EFI_STATUS FatCreateDotDirEnts | ( | IN FAT_OFILE * | OFile | ) |
Create "." and ".." directory entries in the newly-created parent OFile.
OFile | - The parent OFile. |
EFI_SUCCESS | - The dot directory entries are successfully created. |
Definition at line 997 of file DirectoryManage.c.
STATIC EFI_STATUS FatExpandODir | ( | IN FAT_OFILE * | OFile | ) |
Append a zero cluster to the current OFile.
OFile | - The directory OFile which needs to be updated. |
EFI_SUCCESS | - Append a zero cluster to the OFile successfully. |
Definition at line 708 of file DirectoryManage.c.
STATIC EFI_STATUS FatFirstFitInsertDirEnt | ( | IN FAT_OFILE * | OFile, |
IN FAT_DIRENT * | DirEnt | ||
) |
Use First Fit Algorithm to insert directory entry. Only this function will erase "E5" entries in a directory. In view of safest recovery, this function will only be triggered when maximum directory entry number has reached.
OFile | - The corresponding OFile. |
DirEnt | - The directory entry to be inserted. |
EFI_SUCCESS | - The directory entry has been successfully inserted. |
EFI_VOLUME_FULL | - The directory can not hold more directory entries. |
Definition at line 776 of file DirectoryManage.c.
EFI_STATUS FatGetDirEntInfo | ( | IN FAT_VOLUME * | Volume, |
IN FAT_DIRENT * | DirEnt, | ||
IN OUT UINTN * | BufferSize, | ||
OUT VOID * | Buffer | ||
) |
Get the directory entry's info into Buffer.
Volume | - FAT file system volume. |
DirEnt | - The corresponding directory entry. |
BufferSize | - Size of Buffer. |
Buffer | - Buffer containing file info. |
EFI_SUCCESS | - Get the file info successfully. |
EFI_BUFFER_TOO_SMALL | - The buffer is too small. |
Definition at line 448 of file DirectoryManage.c.
EFI_STATUS FatGetNextDirEnt | ( | IN FAT_OFILE * | OFile, |
OUT FAT_DIRENT ** | PtrDirEnt | ||
) |
Set the directory's cursor to the next and get the next directory entry.
OFile | - The parent OFile. |
PtrDirEnt | - The next directory entry. |
EFI_SUCCESS | - We get the next directory entry successfully. |
Definition at line 597 of file DirectoryManage.c.
EFI_STATUS FatGetVolumeEntry | ( | IN FAT_VOLUME * | Volume, |
IN CHAR16 * | Name | ||
) |
Get the directory entry for the volume.
Volume | - FAT file system volume. |
Name | - The file name of the volume. |
EFI_SUCCESS | - Update the volume with the directory entry successfully. |
Definition at line 916 of file DirectoryManage.c.
BOOLEAN FatIsDotDirEnt | ( | IN FAT_DIRENT * | DirEnt | ) |
Determine whether the directory entry is "." or ".." entry.
DirEnt | - The corresponding directory entry. |
TRUE | - The directory entry is "." or ".." directory entry |
FALSE | - The directory entry is not "." or ".." directory entry |
Definition at line 143 of file DirectoryManage.c.
STATIC VOID FatLoadLongNameEntry | ( | IN FAT_OFILE * | Parent, |
IN FAT_DIRENT * | DirEnt | ||
) |
Get the LFN for the directory entry.
Parent | - The parent directory. |
DirEnt | - The directory entry to get LFN. |
Definition at line 232 of file DirectoryManage.c.
STATIC EFI_STATUS FatLoadNextDirEnt | ( | IN FAT_OFILE * | OFile, |
OUT FAT_DIRENT ** | PtrDirEnt | ||
) |
Load from disk the next directory entry at current end of directory position.
OFile | - The parent OFile. |
PtrDirEnt | - The directory entry that is loaded. |
EFI_SUCCESS | - Load the directory entry successfully. |
EFI_OUT_OF_RESOURCES | - Out of resource. |
Definition at line 345 of file DirectoryManage.c.
EFI_STATUS FatLocateOFile | ( | IN OUT FAT_OFILE ** | PtrOFile, |
IN CHAR16 * | FileName, | ||
IN UINT8 | Attributes, | ||
OUT CHAR16 * | NewFileName | ||
) |
Traverse filename and open all OFiles that can be opened. Update filename pointer to the component that can't be opened. If more than one name component remains, returns an error; otherwise, return the remaining name component so that the caller might choose to create it.
PtrOFile | - As input, the reference OFile; as output, the located OFile. |
FileName | - The file name relevant to the OFile. |
Attributes | - The attribute of the destination OFile. |
NewFileName | - The remaining file name. |
EFI_NOT_FOUND | - The file name can't be opened and there is more than one components within the name left (this means the name can not be created either). |
EFI_INVALID_PARAMETER | - The parameter is not valid. |
EFI_SUCCESS | - Open the file successfully. |
Definition at line 1268 of file DirectoryManage.c.
STATIC EFI_STATUS FatNewEntryPos | ( | IN FAT_OFILE * | OFile, |
IN FAT_DIRENT * | DirEnt | ||
) |
Find the new directory entry position for the directory entry.
OFile | - The corresponding OFile. |
DirEnt | - The directory entry whose new position is to be set. |
EFI_SUCCESS | - The new directory entry position is successfully found. |
EFI_VOLUME_FULL | - The directory has reach its maximum capacity. |
Definition at line 850 of file DirectoryManage.c.
EFI_STATUS FatOpenDirEnt | ( | IN FAT_OFILE * | Parent, |
IN FAT_DIRENT * | DirEnt | ||
) |
Open the directory entry to get the OFile.
Parent | - The parent OFile. |
DirEnt | - The directory entry to be opened. |
EFI_SUCCESS | - The directory entry is successfully opened. |
EFI_OUT_OF_RESOURCES | - not enough memory to allocate a new OFile. |
Definition at line 1142 of file DirectoryManage.c.
EFI_STATUS FatRemoveDirEnt | ( | IN FAT_OFILE * | OFile, |
IN FAT_DIRENT * | DirEnt | ||
) |
Remove this directory entry node from the list of directory entries and hash table.
OFile | - The parent OFile. |
DirEnt | - The directory entry to be removed. |
EFI_SUCCESS | - The directory entry is successfully removed. |
Definition at line 1101 of file DirectoryManage.c.
Set the OFile's current directory cursor to the list head.
OFile | - The directory OFile whose directory cursor is reset. |
Definition at line 573 of file DirectoryManage.c.
STATIC EFI_STATUS FatSearchODir | ( | IN FAT_OFILE * | OFile, |
IN CHAR16 * | FileNameString, | ||
OUT FAT_DIRENT ** | PtrDirEnt | ||
) |
Search the directory for the directory entry whose filename is FileNameString.
OFile | - The parent OFile whose directory is to be searched. |
FileNameString | - The filename to be searched. |
PtrDirEnt | - pointer to the directory entry if found. |
EFI_SUCCESS | - Find the directory entry or not found. |
Definition at line 512 of file DirectoryManage.c.
STATIC EFI_STATUS FatSeekVolumeId | ( | IN FAT_OFILE * | Root, |
OUT FAT_DIRENT * | DirEnt | ||
) |
Search the Root OFile for the possible volume label.
Root | - The Root OFile. |
DirEnt | - The returned directory entry of volume label. |
EFI_SUCCESS | - The search process is completed successfully. |
Definition at line 728 of file DirectoryManage.c.
Set the OFile's cluster info in its directory entry.
OFile | - The corresponding OFile. |
Definition at line 166 of file DirectoryManage.c.
STATIC VOID FatSetEntryCount | ( | IN FAT_OFILE * | OFile, |
IN FAT_DIRENT * | DirEnt | ||
) |
Set the directory entry count according to the filename.
OFile | - The corresponding OFile. |
DirEnt | - The directory entry to be set. |
Definition at line 649 of file DirectoryManage.c.
EFI_STATUS FatSetVolumeEntry | ( | IN FAT_VOLUME * | Volume, |
IN CHAR16 * | Name | ||
) |
Set the relevant directory entry into disk for the volume.
Volume | - FAT file system volume. |
Name | - The new file name of the volume. |
EFI_SUCCESS | - Update the Volume successfully. |
EFI_UNSUPPORTED | - The input label is not a valid volume label. |
Definition at line 948 of file DirectoryManage.c.
EFI_STATUS FatStoreDirEnt | ( | IN FAT_OFILE * | OFile, |
IN FAT_DIRENT * | DirEnt | ||
) |
Save the directory entry to disk.
OFile | - The parent OFile which needs to update. |
DirEnt | - The directory entry to be saved. |
EFI_SUCCESS | - Store the directory entry successfully. |
Definition at line 63 of file DirectoryManage.c.
Set the OFile's cluster and size info in its directory entry.
OFile | - The corresponding OFile. |
Definition at line 187 of file DirectoryManage.c.