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

Go to the source code of this file.

Functions

STATIC EFI_STATUS PopulateFileInfo (IN VIRTIO_FS_FUSE_DIRENTPLUS_RESPONSE *Dirent, IN UINTN SingleFileInfoSize, OUT EFI_FILE_INFO *FileInfo)
 
STATIC EFI_STATUS RefillFileInfoCache (IN OUT VIRTIO_FS_FILE *VirtioFsFile)
 
STATIC EFI_STATUS ReadFileInfoCache (IN OUT VIRTIO_FS_FILE *VirtioFsFile, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
 
STATIC EFI_STATUS ReadRegularFile (IN OUT VIRTIO_FS_FILE *VirtioFsFile, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
 
EFI_STATUS EFIAPI VirtioFsSimpleFileRead (IN EFI_FILE_PROTOCOL *This, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
 

Detailed Description

EFI_FILE_PROTOCOL.Read() member function for the Virtio Filesystem driver.

Copyright (C) 2020, Red Hat, Inc.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file SimpleFsRead.c.

Function Documentation

◆ PopulateFileInfo()

STATIC EFI_STATUS PopulateFileInfo ( IN VIRTIO_FS_FUSE_DIRENTPLUS_RESPONSE Dirent,
IN UINTN  SingleFileInfoSize,
OUT EFI_FILE_INFO FileInfo 
)

Populate a caller-allocated EFI_FILE_INFO object from VIRTIO_FS_FUSE_DIRENTPLUS_RESPONSE.

Parameters
[in]DirentThe entry read from the directory stream. The caller is responsible for ensuring that Dirent->Namelen describe valid storage.
[in]SingleFileInfoSizeThe allocated size of FileInfo.
[out]FileInfoThe EFI_FILE_INFO object to populate. On success, all fields in FileInfo will be updated, setting FileInfo->Size to the actually used size (which will not exceed SingleFileInfoSize).
Return values
EFI_SUCCESSFileInfo has been filled in.
Returns
Error codes propagated from VirtioFsFuseDirentPlusToEfiFileInfo() and VirtioFsFuseAttrToEfiFileInfo(). The contents of FileInfo are indeterminate.

Definition at line 39 of file SimpleFsRead.c.

◆ ReadFileInfoCache()

STATIC EFI_STATUS ReadFileInfoCache ( IN OUT VIRTIO_FS_FILE VirtioFsFile,
IN OUT UINTN BufferSize,
OUT VOID *  Buffer 
)

Read an entry from the EFI_FILE_INFO cache.

Definition at line 305 of file SimpleFsRead.c.

◆ ReadRegularFile()

STATIC EFI_STATUS ReadRegularFile ( IN OUT VIRTIO_FS_FILE VirtioFsFile,
IN OUT UINTN BufferSize,
OUT VOID *  Buffer 
)

Read from a regular file.

Definition at line 370 of file SimpleFsRead.c.

◆ RefillFileInfoCache()

STATIC EFI_STATUS RefillFileInfoCache ( IN OUT VIRTIO_FS_FILE VirtioFsFile)

Refill the EFI_FILE_INFO cache from the directory stream.

Definition at line 68 of file SimpleFsRead.c.

◆ VirtioFsSimpleFileRead()

EFI_STATUS EFIAPI VirtioFsSimpleFileRead ( IN EFI_FILE_PROTOCOL This,
IN OUT UINTN BufferSize,
OUT VOID *  Buffer 
)

Definition at line 431 of file SimpleFsRead.c.