/* The found FSD will contain the extent (LogicalVolumeContentsUse) where our root directory is. */
EFI_STATUS FindFileSetDescriptor(IN EFI_BLOCK_IO_PROTOCOL *BlockIo, IN EFI_DISK_IO_PROTOCOL *DiskIo, IN UDF_VOLUME_INFO *Volume)
/* The found FSD will contain the extent (LogicalVolumeContentsUse) where our root directory is. */
EFI_STATUS FindFileSetDescriptor(IN EFI_BLOCK_IO_PROTOCOL *BlockIo, IN EFI_DISK_IO_PROTOCOL *DiskIo, IN UDF_VOLUME_INFO *Volume)
{
  EFI_STATUS                     Status;
  UINT64                         Lsn;
  UDF_LOGICAL_VOLUME_DESCRIPTOR  *LogicalVolDesc;
  UDF_DESCRIPTOR_TAG             *DescriptorTag;
  LogicalVolDesc = &Volume->LogicalVolDesc;
  Status         = GetLongAdLsn (Volume, &LogicalVolDesc->LogicalVolumeContentsUse, &Lsn);
  if (EFI_ERROR (Status)) {
    return Status;
  }
  Status = DiskIo->ReadDisk (
                     DiskIo,
                     BlockIo->Media->MediaId,
                     MultU64x32 (Lsn, LogicalVolDesc->LogicalBlockSize),
                     sizeof (Volume->FileSetDesc),
                     &Volume->FileSetDesc
                     );
  if (EFI_ERROR (Status)) {
    return Status;
  }
  DescriptorTag = &Volume->FileSetDesc.DescriptorTag;
  if (DescriptorTag->TagIdentifier != UdfFileSetDescriptor) {
    return EFI_VOLUME_CORRUPTED;
  }
  return EFI_SUCCESS;
}