/* Read Length bytes from the position of Offset into Buffer, or write Length bytes from Buffer into the position of Offset. */
STATIC EFI_STATUS FatAccessUnalignedCachePage(IN FAT_VOLUME *Volume, IN CACHE_DATA_TYPE CacheDataType, IN IO_MODE IoMode, IN UINTN PageNo, IN UINTN Offset, IN UINTN Length, IN OUT VOID *Buffer)
/* Read Length bytes from the position of Offset into Buffer, or write Length bytes from Buffer into the position of Offset. */
STATIC EFI_STATUS FatAccessUnalignedCachePage(IN FAT_VOLUME *Volume, IN CACHE_DATA_TYPE CacheDataType, IN IO_MODE IoMode, IN UINTN PageNo, IN UINTN Offset, IN UINTN Length, IN OUT VOID *Buffer)
{
  EFI_STATUS  Status;
  VOID        *Source;
  VOID        *Destination;
  DISK_CACHE  *DiskCache;
  CACHE_TAG   *CacheTag;
  UINTN       GroupNo;
  DiskCache = &Volume->DiskCache[CacheDataType];
  GroupNo   = PageNo & DiskCache->GroupMask;
  CacheTag  = &DiskCache->CacheTag[GroupNo];
  Status    = FatGetCachePage (Volume, CacheDataType, PageNo, CacheTag);
  if (!EFI_ERROR (Status)) {
    Source      = DiskCache->CacheBase + (GroupNo << DiskCache->PageAlignment) + Offset;
    Destination = Buffer;
    if (IoMode != ReadDisk) {
      CacheTag->Dirty  = TRUE;
      DiskCache->Dirty = TRUE;
      Destination      = Source;
      Source           = Buffer;
    }
    CopyMem (Destination, Source, Length);
  }
  return Status;
}