35 VirtioFsFile = VIRTIO_FS_FILE_FROM_SIMPLE_FILE (This);
36 VirtioFs = VirtioFsFile->OwnerFs;
38 AllocSize = *BufferSize;
45 VirtioFsFile->CanonicalPathname,
49 ASSERT (Status == EFI_BUFFER_TOO_SMALL);
52 if (*BufferSize > AllocSize) {
53 return EFI_BUFFER_TOO_SMALL;
62 VirtioFsFile->CanonicalPathname,
72 if (!EFI_ERROR (Status)) {
76 return (Status == EFI_BUFFER_TOO_SMALL) ? EFI_DEVICE_ERROR : Status;
99 VirtioFsFile = VIRTIO_FS_FILE_FROM_SIMPLE_FILE (This);
100 VirtioFs = VirtioFsFile->OwnerFs;
102 AllocSize = *BufferSize;
107 LabelSize =
StrSize (VirtioFs->Label);
110 if (*BufferSize > AllocSize) {
111 return EFI_BUFFER_TOO_SMALL;
118 if (EFI_ERROR (Status)) {
119 return (Status == EFI_BUFFER_TOO_SMALL) ? EFI_DEVICE_ERROR : Status;
125 if (FilesysAttr.Frsize != FilesysAttr.Bsize) {
126 return EFI_UNSUPPORTED;
129 if ((FilesysAttr.Frsize == 0) || (FilesysAttr.Blocks == 0) ||
130 (FilesysAttr.Bavail > FilesysAttr.Blocks))
132 return EFI_DEVICE_ERROR;
135 MaxBlocks =
DivU64x32 (MAX_UINT64, FilesysAttr.Frsize);
136 if ((FilesysAttr.Blocks > MaxBlocks) || (FilesysAttr.Bavail > MaxBlocks)) {
137 return EFI_DEVICE_ERROR;
143 FilesysInfo = Buffer;
144 FilesysInfo->
Size = *BufferSize;
154 FilesysInfo->
BlockSize = FilesysAttr.Frsize;
177 VirtioFsFile = VIRTIO_FS_FILE_FROM_SIMPLE_FILE (This);
178 VirtioFs = VirtioFsFile->OwnerFs;
180 AllocSize = *BufferSize;
185 LabelSize =
StrSize (VirtioFs->Label);
189 if (*BufferSize > AllocSize) {
190 return EFI_BUFFER_TOO_SMALL;
196 FilesysVolumeLabel = Buffer;
204VirtioFsSimpleFileGetInfo (
211 if (
CompareGuid (InformationType, &gEfiFileInfoGuid)) {
215 if (
CompareGuid (InformationType, &gEfiFileSystemInfoGuid)) {
219 if (
CompareGuid (InformationType, &gEfiFileSystemVolumeLabelInfoIdGuid)) {
223 return EFI_UNSUPPORTED;
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
UINT64 EFIAPI DivU64x32(IN UINT64 Dividend, IN UINT32 Divisor)
UINT64 EFIAPI MultU64x32(IN UINT64 Multiplicand, IN UINT32 Multiplier)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
EFI_STATUS VirtioFsFuseGetAttr(IN OUT VIRTIO_FS *VirtioFs, IN UINT64 NodeId, OUT VIRTIO_FS_FUSE_ATTRIBUTES_RESPONSE *FuseAttr)
EFI_STATUS VirtioFsFuseStatFs(IN OUT VIRTIO_FS *VirtioFs, IN UINT64 NodeId, OUT VIRTIO_FS_FUSE_STATFS_RESPONSE *FilesysAttr)
#define OFFSET_OF(TYPE, Field)
#define ASSERT_EFI_ERROR(StatusParameter)
EFI_FILE_INFO * FileInfo(IN EFI_FILE_HANDLE FHand)
STATIC EFI_STATUS GetFileSystemVolumeLabelInfo(IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
STATIC EFI_STATUS GetFileInfo(IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
STATIC EFI_STATUS GetFileSystemInfo(IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
EFI_STATUS VirtioFsGetBasename(IN CHAR8 *Path, OUT CHAR16 *Basename OPTIONAL, IN OUT UINTN *BasenameSize)
EFI_STATUS VirtioFsFuseAttrToEfiFileInfo(IN VIRTIO_FS_FUSE_ATTRIBUTES_RESPONSE *FuseAttr, OUT EFI_FILE_INFO *FileInfo)