TianoCore EDK2 master
Loading...
Searching...
No Matches
SimpleFsSetInfo.c File Reference

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)
 

Detailed Description

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.

Function Documentation

◆ Rename()

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.

Parameters
[in,out]VirtioFsFileThe VIRTIO_FS_FILE to rename.
[in]NewFileNameThe new file name requested by EFI_FILE_PROTOCOL.SetInfo().
Return values
EFI_SUCCESSThe 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_SUCCESSVirtioFsFile has been renamed. VirtioFsFile->CanonicalPathname has assumed the destination pathname in canonical format.
EFI_ACCESS_DENIEDVirtioFsFile refers to the root directory, and NewFileName expresses an actual rename/move request.
EFI_ACCESS_DENIEDVirtioFsFile 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_DENIEDVirtioFsFile is not open for writing, but NewFileName expresses an actual rename/move request.
EFI_NOT_FOUNDAt least one dot-dot component in NewFileName attempted to escape the root directory.
Returns
Error codes propagated from underlying functions.

Definition at line 174 of file SimpleFsSetInfo.c.

◆ SetFileInfo()

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.

◆ SetFileSystemInfo()

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.

◆ SetFileSystemVolumeLabelInfo()

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.

◆ UpdateAttributes()

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.

Parameters
[in,out]VirtioFsFileThe VIRTIO_FS_FILE to update the attributes of.
[in]NewFileInfoThe new attributes requested by EFI_FILE_PROTOCOL.SetInfo(). NewFileInfo->Size and NewFileInfo->FileName are ignored.
Return values
EFI_SUCCESSNo attributes had to be updated.
EFI_SUCCESSThe required set of attribute updates has been determined and performed successfully.
EFI_ACCESS_DENIEDNewFileInfo 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.
Returns
Error codes propagated from underlying functions.

Definition at line 362 of file SimpleFsSetInfo.c.

◆ ValidateInfoStructure()

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.

Parameters
[in]SizeByProtocolCallerThe BufferSize parameter as provided by the EFI_FILE_PROTOCOL.SetInfo() caller.
[in]MinimumStructSizeThe minimum structure size that is required for the given InformationType GUID, including a single CHAR16 element from the trailing Name field.
[in]IsSizeByInfoPresentTRUE if and only if the expected structure starts with a UINT64 Size field that reports the actual structure size.
[in]BufferThe Buffer parameter as provided by the EFI_FILE_PROTOCOL.SetInfo() caller.
Return values
EFI_SUCCESSValidation successful, Buffer is well-formed.
EFI_BAD_BUFFER_SIZEThe EFI_FILE_PROTOCOL.SetInfo() caller provided a BufferSize that is smaller than the minimum structure size required for the given InformationType GUID.
EFI_INVALID_PARAMETERIsSizeByInfoPresent is TRUE, and the leading UINT64 Size field does not match the EFI_FILE_PROTOCOL.SetInfo() caller-provided BufferSize.
EFI_INVALID_PARAMETERThe trailing Name field does not consist of a whole multiple of CHAR16 elements.
EFI_INVALID_PARAMETERThe trailing Name field is not NUL-terminated.

Definition at line 58 of file SimpleFsSetInfo.c.

◆ VirtioFsSimpleFileSetInfo()

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.