-//\r
-// Get all File Set Descriptors for each Logical Volume Descriptor.\r
-//\r
-EFI_STATUS\r
-GetFileSetDescriptors (\r
- IN EFI_BLOCK_IO_PROTOCOL *BlockIo,\r
- IN EFI_DISK_IO_PROTOCOL *DiskIo,\r
- IN OUT UDF_VOLUME_INFO *Volume\r
- )\r
-{\r
- EFI_STATUS Status;\r
- UINTN Index;\r
- UDF_FILE_SET_DESCRIPTOR *FileSetDesc;\r
- UINTN Count;\r
-\r
- Volume->FileSetDescs =\r
- (UDF_FILE_SET_DESCRIPTOR **)AllocateZeroPool (\r
- Volume->LogicalVolDescsNo * sizeof (UDF_FILE_SET_DESCRIPTOR));\r
- if (Volume->FileSetDescs == NULL) {\r
- return EFI_OUT_OF_RESOURCES;\r
- }\r
-\r
- for (Index = 0; Index < Volume->LogicalVolDescsNo; Index++) {\r
- FileSetDesc = AllocateZeroPool (sizeof (UDF_FILE_SET_DESCRIPTOR));\r
- if (FileSetDesc == NULL) {\r
- Status = EFI_OUT_OF_RESOURCES;\r
- goto Error_Alloc_Fsd;\r
- }\r
-\r
- //\r
- // Find a FSD for this LVD.\r
- //\r
- Status = FindFileSetDescriptor (\r
- BlockIo,\r
- DiskIo,\r
- Volume,\r
- Index,\r
- FileSetDesc\r
- );\r
- if (EFI_ERROR (Status)) {\r
- goto Error_Find_Fsd;\r
- }\r
-\r
- //\r
- // Got one. Save it.\r
- //\r
- Volume->FileSetDescs[Index] = FileSetDesc;\r
- }\r
-\r
- Volume->FileSetDescsNo = Volume->LogicalVolDescsNo;\r
- return EFI_SUCCESS;\r
-\r
-Error_Find_Fsd:\r
- Count = Index + 1;\r
- for (Index = 0; Index < Count; Index++) {\r
- FreePool ((VOID *)Volume->FileSetDescs[Index]);\r
- }\r