TianoCore EDK2 master
|
#include <Guid/FileSystemInfo.h>
#include <Guid/FileSystemVolumeLabelInfo.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include "VirtioFsDxe.h"
Go to the source code of this file.
Functions | |
STATIC EFI_STATUS | ValidateInfoStructure (IN UINTN SizeByProtocolCaller, IN UINTN MinimumStructSize, IN BOOLEAN IsSizeByInfoPresent, IN VOID *Buffer) |
STATIC EFI_STATUS | Rename (IN OUT VIRTIO_FS_FILE *VirtioFsFile, IN CHAR16 *NewFileName) |
STATIC EFI_STATUS | UpdateAttributes (IN OUT VIRTIO_FS_FILE *VirtioFsFile, IN EFI_FILE_INFO *NewFileInfo) |
STATIC EFI_STATUS | SetFileInfo (IN EFI_FILE_PROTOCOL *This, IN UINTN BufferSize, IN VOID *Buffer) |
STATIC EFI_STATUS | SetFileSystemInfo (IN EFI_FILE_PROTOCOL *This, IN UINTN BufferSize, IN VOID *Buffer) |
STATIC EFI_STATUS | SetFileSystemVolumeLabelInfo (IN EFI_FILE_PROTOCOL *This, IN UINTN BufferSize, IN VOID *Buffer) |
EFI_STATUS EFIAPI | VirtioFsSimpleFileSetInfo (IN EFI_FILE_PROTOCOL *This, IN EFI_GUID *InformationType, IN UINTN BufferSize, IN VOID *Buffer) |
EFI_FILE_PROTOCOL.SetInfo() member function for the Virtio Filesystem driver.
Copyright (C) 2020, Red Hat, Inc.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file SimpleFsSetInfo.c.
STATIC EFI_STATUS Rename | ( | IN OUT VIRTIO_FS_FILE * | VirtioFsFile, |
IN CHAR16 * | NewFileName | ||
) |
Rename a VIRTIO_FS_FILE as requested in EFI_FILE_INFO.FileName.
[in,out] | VirtioFsFile | The VIRTIO_FS_FILE to rename. |
[in] | NewFileName | The new file name requested by EFI_FILE_PROTOCOL.SetInfo(). |
EFI_SUCCESS | The canonical format destination path that is determined from the input value of VirtioFsFile->CanonicalPathname and from NewFileName is identical to the input value of VirtioFsFile->CanonicalPathname. This means that EFI_FILE_INFO does not constitute a rename request. VirtioFsFile has not been changed. |
EFI_SUCCESS | VirtioFsFile has been renamed. VirtioFsFile->CanonicalPathname has assumed the destination pathname in canonical format. |
EFI_ACCESS_DENIED | VirtioFsFile refers to the root directory, and NewFileName expresses an actual rename/move request. |
EFI_ACCESS_DENIED | VirtioFsFile is the (possibly indirect) parent directory of at least one other VIRTIO_FS_FILE that is open for the same Virtio Filesystem (identified by VirtioFsFile->OwnerFs). Renaming VirtioFsFile would invalidate the canonical pathnames of those VIRTIO_FS_FILE instances; therefore the request has been rejected. |
EFI_ACCESS_DENIED | VirtioFsFile is not open for writing, but NewFileName expresses an actual rename/move request. |
EFI_NOT_FOUND | At least one dot-dot component in NewFileName attempted to escape the root directory. |
Definition at line 174 of file SimpleFsSetInfo.c.
STATIC EFI_STATUS SetFileInfo | ( | IN EFI_FILE_PROTOCOL * | This, |
IN UINTN | BufferSize, | ||
IN VOID * | Buffer | ||
) |
Process an EFI_FILE_INFO setting request.
Definition at line 468 of file SimpleFsSetInfo.c.
STATIC EFI_STATUS SetFileSystemInfo | ( | IN EFI_FILE_PROTOCOL * | This, |
IN UINTN | BufferSize, | ||
IN VOID * | Buffer | ||
) |
Process an EFI_FILE_SYSTEM_INFO setting request.
Definition at line 523 of file SimpleFsSetInfo.c.
STATIC EFI_STATUS SetFileSystemVolumeLabelInfo | ( | IN EFI_FILE_PROTOCOL * | This, |
IN UINTN | BufferSize, | ||
IN VOID * | Buffer | ||
) |
Process an EFI_FILE_SYSTEM_VOLUME_LABEL setting request.
Definition at line 575 of file SimpleFsSetInfo.c.
STATIC EFI_STATUS UpdateAttributes | ( | IN OUT VIRTIO_FS_FILE * | VirtioFsFile, |
IN EFI_FILE_INFO * | NewFileInfo | ||
) |
Update the attributes of a VIRTIO_FS_FILE as requested in EFI_FILE_INFO.
[in,out] | VirtioFsFile | The VIRTIO_FS_FILE to update the attributes of. |
[in] | NewFileInfo | The new attributes requested by EFI_FILE_PROTOCOL.SetInfo(). NewFileInfo->Size and NewFileInfo->FileName are ignored. |
EFI_SUCCESS | No attributes had to be updated. |
EFI_SUCCESS | The required set of attribute updates has been determined and performed successfully. |
EFI_ACCESS_DENIED | NewFileInfo requests an update to a property different from the EFI_FILE_READ_ONLY bit in the Attribute field, but VirtioFsFile is not open for writing. |
Definition at line 362 of file SimpleFsSetInfo.c.
STATIC EFI_STATUS ValidateInfoStructure | ( | IN UINTN | SizeByProtocolCaller, |
IN UINTN | MinimumStructSize, | ||
IN BOOLEAN | IsSizeByInfoPresent, | ||
IN VOID * | Buffer | ||
) |
Validate a buffer that the EFI_FILE_PROTOCOL.SetInfo() caller passes in for a particular InformationType GUID.
The structure to be validated is supposed to end with a variable-length, NUL-terminated CHAR16 Name string.
[in] | SizeByProtocolCaller | The BufferSize parameter as provided by the EFI_FILE_PROTOCOL.SetInfo() caller. |
[in] | MinimumStructSize | The minimum structure size that is required for the given InformationType GUID, including a single CHAR16 element from the trailing Name field. |
[in] | IsSizeByInfoPresent | TRUE if and only if the expected structure starts with a UINT64 Size field that reports the actual structure size. |
[in] | Buffer | The Buffer parameter as provided by the EFI_FILE_PROTOCOL.SetInfo() caller. |
EFI_SUCCESS | Validation successful, Buffer is well-formed. |
EFI_BAD_BUFFER_SIZE | The EFI_FILE_PROTOCOL.SetInfo() caller provided a BufferSize that is smaller than the minimum structure size required for the given InformationType GUID. |
EFI_INVALID_PARAMETER | IsSizeByInfoPresent is TRUE, and the leading UINT64 Size field does not match the EFI_FILE_PROTOCOL.SetInfo() caller-provided BufferSize. |
EFI_INVALID_PARAMETER | The trailing Name field does not consist of a whole multiple of CHAR16 elements. |
EFI_INVALID_PARAMETER | The trailing Name field is not NUL-terminated. |
Definition at line 58 of file SimpleFsSetInfo.c.
EFI_STATUS EFIAPI VirtioFsSimpleFileSetInfo | ( | IN EFI_FILE_PROTOCOL * | This, |
IN EFI_GUID * | InformationType, | ||
IN UINTN | BufferSize, | ||
IN VOID * | Buffer | ||
) |
Definition at line 621 of file SimpleFsSetInfo.c.