MdeModulePkg/UdfDxe: Refine enum member naming style
Similar to the naming style for variables, it's better for the name of members in a enum type to avoid using only upper-case letters. Cc: Paulo Alcantara <pcacjr@zytor.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Paulo Alcantara <pcacjr@zytor.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
parent
3f92b10493
commit
880ec68338
|
@ -710,9 +710,9 @@ GetLongAdFromAds (
|
||||||
// If it's either an indirect AD (Extended Alllocation Descriptor) or an
|
// If it's either an indirect AD (Extended Alllocation Descriptor) or an
|
||||||
// allocated AD, then return it.
|
// allocated AD, then return it.
|
||||||
//
|
//
|
||||||
ExtentFlags = GET_EXTENT_FLAGS (LONG_ADS_SEQUENCE, LongAd);
|
ExtentFlags = GET_EXTENT_FLAGS (LongAdsSequence, LongAd);
|
||||||
if (ExtentFlags == EXTENT_IS_NEXT_EXTENT ||
|
if (ExtentFlags == ExtentIsNextExtent ||
|
||||||
ExtentFlags == EXTENT_RECORDED_AND_ALLOCATED) {
|
ExtentFlags == ExtentRecordedAndAllocated) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -720,7 +720,7 @@ GetLongAdFromAds (
|
||||||
// This AD is either not recorded but allocated, or not recorded and not
|
// This AD is either not recorded but allocated, or not recorded and not
|
||||||
// allocated. Skip it.
|
// allocated. Skip it.
|
||||||
//
|
//
|
||||||
*Offset += AD_LENGTH (LONG_ADS_SEQUENCE);
|
*Offset += AD_LENGTH (LongAdsSequence);
|
||||||
}
|
}
|
||||||
|
|
||||||
*FoundLongAd = LongAd;
|
*FoundLongAd = LongAd;
|
||||||
|
@ -766,9 +766,9 @@ GetShortAdFromAds (
|
||||||
// If it's either an indirect AD (Extended Alllocation Descriptor) or an
|
// If it's either an indirect AD (Extended Alllocation Descriptor) or an
|
||||||
// allocated AD, then return it.
|
// allocated AD, then return it.
|
||||||
//
|
//
|
||||||
ExtentFlags = GET_EXTENT_FLAGS (SHORT_ADS_SEQUENCE, ShortAd);
|
ExtentFlags = GET_EXTENT_FLAGS (ShortAdsSequence, ShortAd);
|
||||||
if (ExtentFlags == EXTENT_IS_NEXT_EXTENT ||
|
if (ExtentFlags == ExtentIsNextExtent ||
|
||||||
ExtentFlags == EXTENT_RECORDED_AND_ALLOCATED) {
|
ExtentFlags == ExtentRecordedAndAllocated) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -776,7 +776,7 @@ GetShortAdFromAds (
|
||||||
// This AD is either not recorded but allocated, or not recorded and not
|
// This AD is either not recorded but allocated, or not recorded and not
|
||||||
// allocated. Skip it.
|
// allocated. Skip it.
|
||||||
//
|
//
|
||||||
*Offset += AD_LENGTH (SHORT_ADS_SEQUENCE);
|
*Offset += AD_LENGTH (ShortAdsSequence);
|
||||||
}
|
}
|
||||||
|
|
||||||
*FoundShortAd = ShortAd;
|
*FoundShortAd = ShortAd;
|
||||||
|
@ -808,14 +808,14 @@ GetAllocationDescriptor (
|
||||||
OUT VOID **FoundAd
|
OUT VOID **FoundAd
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (RecordingFlags == LONG_ADS_SEQUENCE) {
|
if (RecordingFlags == LongAdsSequence) {
|
||||||
return GetLongAdFromAds (
|
return GetLongAdFromAds (
|
||||||
Data,
|
Data,
|
||||||
Offset,
|
Offset,
|
||||||
Length,
|
Length,
|
||||||
(UDF_LONG_ALLOCATION_DESCRIPTOR **)FoundAd
|
(UDF_LONG_ALLOCATION_DESCRIPTOR **)FoundAd
|
||||||
);
|
);
|
||||||
} else if (RecordingFlags == SHORT_ADS_SEQUENCE) {
|
} else if (RecordingFlags == ShortAdsSequence) {
|
||||||
return GetShortAdFromAds (
|
return GetShortAdFromAds (
|
||||||
Data,
|
Data,
|
||||||
Offset,
|
Offset,
|
||||||
|
@ -846,9 +846,9 @@ GetAllocationDescriptorLsn (
|
||||||
IN VOID *Ad
|
IN VOID *Ad
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (RecordingFlags == LONG_ADS_SEQUENCE) {
|
if (RecordingFlags == LongAdsSequence) {
|
||||||
return GetLongAdLsn (Volume, (UDF_LONG_ALLOCATION_DESCRIPTOR *)Ad);
|
return GetLongAdLsn (Volume, (UDF_LONG_ALLOCATION_DESCRIPTOR *)Ad);
|
||||||
} else if (RecordingFlags == SHORT_ADS_SEQUENCE) {
|
} else if (RecordingFlags == ShortAdsSequence) {
|
||||||
return GetShortAdLsn (
|
return GetShortAdLsn (
|
||||||
GetPdFromLongAd (Volume, ParentIcb),
|
GetPdFromLongAd (Volume, ParentIcb),
|
||||||
(UDF_SHORT_ALLOCATION_DESCRIPTOR *)Ad
|
(UDF_SHORT_ALLOCATION_DESCRIPTOR *)Ad
|
||||||
|
@ -1115,8 +1115,8 @@ ReadFile (
|
||||||
Data = NULL;
|
Data = NULL;
|
||||||
|
|
||||||
switch (ReadFileInfo->Flags) {
|
switch (ReadFileInfo->Flags) {
|
||||||
case READ_FILE_GET_FILESIZE:
|
case ReadFileGetFileSize:
|
||||||
case READ_FILE_ALLOCATE_AND_READ:
|
case ReadFileAllocateAndRead:
|
||||||
//
|
//
|
||||||
// Initialise ReadFileInfo structure for either getting file size, or
|
// Initialise ReadFileInfo structure for either getting file size, or
|
||||||
// reading file's recorded data.
|
// reading file's recorded data.
|
||||||
|
@ -1124,7 +1124,7 @@ ReadFile (
|
||||||
ReadFileInfo->ReadLength = 0;
|
ReadFileInfo->ReadLength = 0;
|
||||||
ReadFileInfo->FileData = NULL;
|
ReadFileInfo->FileData = NULL;
|
||||||
break;
|
break;
|
||||||
case READ_FILE_SEEK_AND_READ:
|
case ReadFileSeekAndRead:
|
||||||
//
|
//
|
||||||
// About to seek a file and/or read its data.
|
// About to seek a file and/or read its data.
|
||||||
//
|
//
|
||||||
|
@ -1149,15 +1149,15 @@ ReadFile (
|
||||||
|
|
||||||
RecordingFlags = GET_FE_RECORDING_FLAGS (FileEntryData);
|
RecordingFlags = GET_FE_RECORDING_FLAGS (FileEntryData);
|
||||||
switch (RecordingFlags) {
|
switch (RecordingFlags) {
|
||||||
case INLINE_DATA:
|
case InlineData:
|
||||||
//
|
//
|
||||||
// There are no extents for this FE/EFE. All data is inline.
|
// There are no extents for this FE/EFE. All data is inline.
|
||||||
//
|
//
|
||||||
GetFileEntryData (FileEntryData, &Data, &Length);
|
GetFileEntryData (FileEntryData, &Data, &Length);
|
||||||
|
|
||||||
if (ReadFileInfo->Flags == READ_FILE_GET_FILESIZE) {
|
if (ReadFileInfo->Flags == ReadFileGetFileSize) {
|
||||||
ReadFileInfo->ReadLength = Length;
|
ReadFileInfo->ReadLength = Length;
|
||||||
} else if (ReadFileInfo->Flags == READ_FILE_ALLOCATE_AND_READ) {
|
} else if (ReadFileInfo->Flags == ReadFileAllocateAndRead) {
|
||||||
//
|
//
|
||||||
// Allocate buffer for starting read data.
|
// Allocate buffer for starting read data.
|
||||||
//
|
//
|
||||||
|
@ -1171,7 +1171,7 @@ ReadFile (
|
||||||
//
|
//
|
||||||
CopyMem (ReadFileInfo->FileData, Data, (UINTN) Length);
|
CopyMem (ReadFileInfo->FileData, Data, (UINTN) Length);
|
||||||
ReadFileInfo->ReadLength = Length;
|
ReadFileInfo->ReadLength = Length;
|
||||||
} else if (ReadFileInfo->Flags == READ_FILE_SEEK_AND_READ) {
|
} else if (ReadFileInfo->Flags == ReadFileSeekAndRead) {
|
||||||
//
|
//
|
||||||
// If FilePosition is non-zero, seek file to FilePosition, read
|
// If FilePosition is non-zero, seek file to FilePosition, read
|
||||||
// FileDataSize bytes and then updates FilePosition.
|
// FileDataSize bytes and then updates FilePosition.
|
||||||
|
@ -1191,8 +1191,8 @@ ReadFile (
|
||||||
Status = EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LONG_ADS_SEQUENCE:
|
case LongAdsSequence:
|
||||||
case SHORT_ADS_SEQUENCE:
|
case ShortAdsSequence:
|
||||||
//
|
//
|
||||||
// This FE/EFE contains a run of Allocation Descriptors. Get data + size
|
// This FE/EFE contains a run of Allocation Descriptors. Get data + size
|
||||||
// for start reading them out.
|
// for start reading them out.
|
||||||
|
@ -1220,7 +1220,7 @@ ReadFile (
|
||||||
// Check if AD is an indirect AD. If so, read Allocation Extent
|
// Check if AD is an indirect AD. If so, read Allocation Extent
|
||||||
// Descriptor and its extents (ADs).
|
// Descriptor and its extents (ADs).
|
||||||
//
|
//
|
||||||
if (GET_EXTENT_FLAGS (RecordingFlags, Ad) == EXTENT_IS_NEXT_EXTENT) {
|
if (GET_EXTENT_FLAGS (RecordingFlags, Ad) == ExtentIsNextExtent) {
|
||||||
if (!DoFreeAed) {
|
if (!DoFreeAed) {
|
||||||
DoFreeAed = TRUE;
|
DoFreeAed = TRUE;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1254,10 +1254,10 @@ ReadFile (
|
||||||
Ad);
|
Ad);
|
||||||
|
|
||||||
switch (ReadFileInfo->Flags) {
|
switch (ReadFileInfo->Flags) {
|
||||||
case READ_FILE_GET_FILESIZE:
|
case ReadFileGetFileSize:
|
||||||
ReadFileInfo->ReadLength += ExtentLength;
|
ReadFileInfo->ReadLength += ExtentLength;
|
||||||
break;
|
break;
|
||||||
case READ_FILE_ALLOCATE_AND_READ:
|
case ReadFileAllocateAndRead:
|
||||||
//
|
//
|
||||||
// Increase FileData (if necessary) to read next extent.
|
// Increase FileData (if necessary) to read next extent.
|
||||||
//
|
//
|
||||||
|
@ -1288,7 +1288,7 @@ ReadFile (
|
||||||
|
|
||||||
ReadFileInfo->ReadLength += ExtentLength;
|
ReadFileInfo->ReadLength += ExtentLength;
|
||||||
break;
|
break;
|
||||||
case READ_FILE_SEEK_AND_READ:
|
case ReadFileSeekAndRead:
|
||||||
//
|
//
|
||||||
// Seek file first before reading in its data.
|
// Seek file first before reading in its data.
|
||||||
//
|
//
|
||||||
|
@ -1364,7 +1364,7 @@ ReadFile (
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case EXTENDED_ADS_SEQUENCE:
|
case ExtendedAdsSequence:
|
||||||
// FIXME: Not supported. Got no volume with it, yet.
|
// FIXME: Not supported. Got no volume with it, yet.
|
||||||
ASSERT (FALSE);
|
ASSERT (FALSE);
|
||||||
Status = EFI_UNSUPPORTED;
|
Status = EFI_UNSUPPORTED;
|
||||||
|
@ -1388,7 +1388,7 @@ Done:
|
||||||
|
|
||||||
Error_Read_Disk_Blk:
|
Error_Read_Disk_Blk:
|
||||||
Error_Alloc_Buffer_To_Next_Ad:
|
Error_Alloc_Buffer_To_Next_Ad:
|
||||||
if (ReadFileInfo->Flags != READ_FILE_SEEK_AND_READ) {
|
if (ReadFileInfo->Flags != ReadFileSeekAndRead) {
|
||||||
FreePool (ReadFileInfo->FileData);
|
FreePool (ReadFileInfo->FileData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1911,7 +1911,7 @@ ReadDirectoryEntry (
|
||||||
// The directory's recorded data has not been read yet. So let's cache it
|
// The directory's recorded data has not been read yet. So let's cache it
|
||||||
// into memory and the next calls won't need to read it again.
|
// into memory and the next calls won't need to read it again.
|
||||||
//
|
//
|
||||||
ReadFileInfo.Flags = READ_FILE_ALLOCATE_AND_READ;
|
ReadFileInfo.Flags = ReadFileAllocateAndRead;
|
||||||
|
|
||||||
Status = ReadFile (
|
Status = ReadFile (
|
||||||
BlockIo,
|
BlockIo,
|
||||||
|
@ -2061,7 +2061,7 @@ ResolveSymlink (
|
||||||
// all its data here -- usually the data will be inline with the FE/EFE for
|
// all its data here -- usually the data will be inline with the FE/EFE for
|
||||||
// lower filenames.
|
// lower filenames.
|
||||||
//
|
//
|
||||||
ReadFileInfo.Flags = READ_FILE_ALLOCATE_AND_READ;
|
ReadFileInfo.Flags = ReadFileAllocateAndRead;
|
||||||
|
|
||||||
Status = ReadFile (
|
Status = ReadFile (
|
||||||
BlockIo,
|
BlockIo,
|
||||||
|
@ -2284,7 +2284,7 @@ GetFileSize (
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
UDF_READ_FILE_INFO ReadFileInfo;
|
UDF_READ_FILE_INFO ReadFileInfo;
|
||||||
|
|
||||||
ReadFileInfo.Flags = READ_FILE_GET_FILESIZE;
|
ReadFileInfo.Flags = ReadFileGetFileSize;
|
||||||
|
|
||||||
Status = ReadFile (
|
Status = ReadFile (
|
||||||
BlockIo,
|
BlockIo,
|
||||||
|
@ -2610,7 +2610,7 @@ ReadFileData (
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
UDF_READ_FILE_INFO ReadFileInfo;
|
UDF_READ_FILE_INFO ReadFileInfo;
|
||||||
|
|
||||||
ReadFileInfo.Flags = READ_FILE_SEEK_AND_READ;
|
ReadFileInfo.Flags = ReadFileSeekAndRead;
|
||||||
ReadFileInfo.FilePosition = *FilePosition;
|
ReadFileInfo.FilePosition = *FilePosition;
|
||||||
ReadFileInfo.FileData = Buffer;
|
ReadFileInfo.FileData = Buffer;
|
||||||
ReadFileInfo.FileDataSize = *BufferSize;
|
ReadFileInfo.FileDataSize = *BufferSize;
|
||||||
|
|
|
@ -106,10 +106,10 @@
|
||||||
!IS_FID_PARENT_FILE (_Pointer)))
|
!IS_FID_PARENT_FILE (_Pointer)))
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
SHORT_ADS_SEQUENCE,
|
ShortAdsSequence,
|
||||||
LONG_ADS_SEQUENCE,
|
LongAdsSequence,
|
||||||
EXTENDED_ADS_SEQUENCE,
|
ExtendedAdsSequence,
|
||||||
INLINE_DATA
|
InlineData
|
||||||
} UDF_FE_RECORDING_FLAGS;
|
} UDF_FE_RECORDING_FLAGS;
|
||||||
|
|
||||||
#define GET_FE_RECORDING_FLAGS(_Fe) \
|
#define GET_FE_RECORDING_FLAGS(_Fe) \
|
||||||
|
@ -118,26 +118,26 @@ typedef enum {
|
||||||
sizeof (UDF_DESCRIPTOR_TAG)))->Flags & 0x07)
|
sizeof (UDF_DESCRIPTOR_TAG)))->Flags & 0x07)
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
EXTENT_RECORDED_AND_ALLOCATED,
|
ExtentRecordedAndAllocated,
|
||||||
EXTENT_NOT_RECORDED_BUT_ALLOCATED,
|
ExtentNotRecordedButAllocated,
|
||||||
EXTENT_NOT_RECORDED_NOT_ALLOCATED,
|
ExtentNotRecordedNotAllocated,
|
||||||
EXTENT_IS_NEXT_EXTENT,
|
ExtentIsNextExtent,
|
||||||
} UDF_EXTENT_FLAGS;
|
} UDF_EXTENT_FLAGS;
|
||||||
|
|
||||||
#define AD_LENGTH(_RecFlags) \
|
#define AD_LENGTH(_RecFlags) \
|
||||||
((_RecFlags) == SHORT_ADS_SEQUENCE ? \
|
((_RecFlags) == ShortAdsSequence ? \
|
||||||
((UINT64)(sizeof (UDF_SHORT_ALLOCATION_DESCRIPTOR))) : \
|
((UINT64)(sizeof (UDF_SHORT_ALLOCATION_DESCRIPTOR))) : \
|
||||||
((UINT64)(sizeof (UDF_LONG_ALLOCATION_DESCRIPTOR))))
|
((UINT64)(sizeof (UDF_LONG_ALLOCATION_DESCRIPTOR))))
|
||||||
|
|
||||||
#define GET_EXTENT_FLAGS(_RecFlags, _Ad) \
|
#define GET_EXTENT_FLAGS(_RecFlags, _Ad) \
|
||||||
((_RecFlags) == SHORT_ADS_SEQUENCE ? \
|
((_RecFlags) == ShortAdsSequence ? \
|
||||||
((UDF_EXTENT_FLAGS)((((UDF_SHORT_ALLOCATION_DESCRIPTOR *)(_Ad))->ExtentLength >> \
|
((UDF_EXTENT_FLAGS)((((UDF_SHORT_ALLOCATION_DESCRIPTOR *)(_Ad))->ExtentLength >> \
|
||||||
30) & 0x3)) : \
|
30) & 0x3)) : \
|
||||||
((UDF_EXTENT_FLAGS)((((UDF_LONG_ALLOCATION_DESCRIPTOR *)(_Ad))->ExtentLength >> \
|
((UDF_EXTENT_FLAGS)((((UDF_LONG_ALLOCATION_DESCRIPTOR *)(_Ad))->ExtentLength >> \
|
||||||
30) & 0x3)))
|
30) & 0x3)))
|
||||||
|
|
||||||
#define GET_EXTENT_LENGTH(_RecFlags, _Ad) \
|
#define GET_EXTENT_LENGTH(_RecFlags, _Ad) \
|
||||||
((_RecFlags) == SHORT_ADS_SEQUENCE ? \
|
((_RecFlags) == ShortAdsSequence ? \
|
||||||
((UINT32)((((UDF_SHORT_ALLOCATION_DESCRIPTOR *)(_Ad))->ExtentLength & \
|
((UINT32)((((UDF_SHORT_ALLOCATION_DESCRIPTOR *)(_Ad))->ExtentLength & \
|
||||||
~0xC0000000UL))) : \
|
~0xC0000000UL))) : \
|
||||||
((UINT32)((((UDF_LONG_ALLOCATION_DESCRIPTOR *)(_Ad))->ExtentLength & \
|
((UINT32)((((UDF_LONG_ALLOCATION_DESCRIPTOR *)(_Ad))->ExtentLength & \
|
||||||
|
@ -169,9 +169,9 @@ typedef struct {
|
||||||
#pragma pack()
|
#pragma pack()
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
READ_FILE_GET_FILESIZE,
|
ReadFileGetFileSize,
|
||||||
READ_FILE_ALLOCATE_AND_READ,
|
ReadFileAllocateAndRead,
|
||||||
READ_FILE_SEEK_AND_READ,
|
ReadFileSeekAndRead,
|
||||||
} UDF_READ_FILE_FLAGS;
|
} UDF_READ_FILE_FLAGS;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
Loading…
Reference in New Issue