MdeModulePkg/UDF: Fix creation of UDF logical partition
Do not reserve entire block device size for an UDF file system - instead, reserve the appropriate space (UDF logical volume space) for it. Additionally, only create a logical partition for UDF logical volumes that are currently supported by EDK2 UDF file system implementation. For instance, an UDF volume with a single LVD and a single Physical (Type 1) Partition will be supported. Cc: Eric Dong <eric.dong@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Reported-by: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Paulo Alcantara <pcacjr@zytor.com> Tested-by: Hao Wu <hao.a.wu@intel.com> Build-tested-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Build-tested-by: Star Zeng <star.zeng@intel.com> Build-tested-by: Paulo Alcantara <paulo@hp.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
This commit is contained in:
committed by
Star Zeng
parent
264d16fcbf
commit
baaa3cee1e
@@ -131,7 +131,6 @@ Error_Alloc_Priv_File_Data:
|
||||
CleanupFileInformation (&PrivFsData->Root);
|
||||
|
||||
Error_Find_Root_Dir:
|
||||
CleanupVolumeInformation (&PrivFsData->Volume);
|
||||
|
||||
Error_Read_Udf_Volume:
|
||||
Error_Invalid_Params:
|
||||
@@ -429,7 +428,7 @@ UdfRead (
|
||||
}
|
||||
ASSERT (NewFileEntryData != NULL);
|
||||
|
||||
if (IS_FE_SYMLINK (NewFileEntryData)) {
|
||||
if (FE_ICB_FILE_TYPE (NewFileEntryData) == UdfFileEntrySymlink) {
|
||||
Status = ResolveSymlink (
|
||||
BlockIo,
|
||||
DiskIo,
|
||||
@@ -529,7 +528,6 @@ UdfClose (
|
||||
EFI_TPL OldTpl;
|
||||
EFI_STATUS Status;
|
||||
PRIVATE_UDF_FILE_DATA *PrivFileData;
|
||||
PRIVATE_UDF_SIMPLE_FS_DATA *PrivFsData;
|
||||
|
||||
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
|
||||
|
||||
@@ -542,8 +540,6 @@ UdfClose (
|
||||
|
||||
PrivFileData = PRIVATE_UDF_FILE_DATA_FROM_THIS (This);
|
||||
|
||||
PrivFsData = PRIVATE_UDF_SIMPLE_FS_DATA_FROM_THIS (PrivFileData->SimpleFs);
|
||||
|
||||
if (!PrivFileData->IsRootDirectory) {
|
||||
CleanupFileInformation (&PrivFileData->File);
|
||||
|
||||
@@ -552,10 +548,6 @@ UdfClose (
|
||||
}
|
||||
}
|
||||
|
||||
if (--PrivFsData->OpenFiles == 0) {
|
||||
CleanupVolumeInformation (&PrivFsData->Volume);
|
||||
}
|
||||
|
||||
FreePool ((VOID *)PrivFileData);
|
||||
|
||||
Exit:
|
||||
@@ -652,7 +644,7 @@ UdfGetPosition (
|
||||
// As per UEFI spec, if the file handle is a directory, then the current file
|
||||
// position has no meaning and the operation is not supported.
|
||||
//
|
||||
if (IS_FID_DIRECTORY_FILE (&PrivFileData->File.FileIdentifierDesc)) {
|
||||
if (IS_FID_DIRECTORY_FILE (PrivFileData->File.FileIdentifierDesc)) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
@@ -788,7 +780,7 @@ UdfGetInfo (
|
||||
} else if (CompareGuid (InformationType, &gEfiFileSystemInfoGuid)) {
|
||||
String = VolumeLabel;
|
||||
|
||||
FileSetDesc = PrivFsData->Volume.FileSetDescs[0];
|
||||
FileSetDesc = &PrivFsData->Volume.FileSetDesc;
|
||||
|
||||
OstaCompressed = &FileSetDesc->LogicalVolumeIdentifier[0];
|
||||
|
||||
@@ -847,7 +839,7 @@ UdfGetInfo (
|
||||
FileSystemInfo->Size = FileSystemInfoLength;
|
||||
FileSystemInfo->ReadOnly = TRUE;
|
||||
FileSystemInfo->BlockSize =
|
||||
LV_BLOCK_SIZE (&PrivFsData->Volume, UDF_DEFAULT_LV_NUM);
|
||||
PrivFsData->Volume.LogicalVolDesc.LogicalBlockSize;
|
||||
FileSystemInfo->VolumeSize = VolumeSize;
|
||||
FileSystemInfo->FreeSpace = FreeSpaceSize;
|
||||
|
||||
|
Reference in New Issue
Block a user