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

Go to the source code of this file.

Functions

STATIC EFI_STATUS OpenRootDirectory (IN OUT VIRTIO_FS *VirtioFs, OUT EFI_FILE_PROTOCOL **NewHandle, IN BOOLEAN OpenForWriting)
 
STATIC EFI_STATUS OpenExistentFileOrDirectory (IN OUT VIRTIO_FS *VirtioFs, IN UINT64 DirNodeId, IN CHAR8 *Name, IN BOOLEAN OpenForWriting, OUT UINT64 *NodeId, OUT UINT64 *FuseHandle, OUT BOOLEAN *NodeIsDirectory)
 
STATIC EFI_STATUS CreateDirectory (IN OUT VIRTIO_FS *VirtioFs, IN UINT64 DirNodeId, IN CHAR8 *Name, OUT UINT64 *NodeId, OUT UINT64 *FuseHandle)
 
STATIC EFI_STATUS CreateRegularFile (IN OUT VIRTIO_FS *VirtioFs, IN UINT64 DirNodeId, IN CHAR8 *Name, OUT UINT64 *NodeId, OUT UINT64 *FuseHandle)
 
EFI_STATUS EFIAPI VirtioFsSimpleFileOpen (IN EFI_FILE_PROTOCOL *This, OUT EFI_FILE_PROTOCOL **NewHandle, IN CHAR16 *FileName, IN UINT64 OpenMode, IN UINT64 Attributes)
 

Detailed Description

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

Copyright (C) 2020, Red Hat, Inc.

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

Definition in file SimpleFsOpen.c.

Function Documentation

◆ CreateDirectory()

STATIC EFI_STATUS CreateDirectory ( IN OUT VIRTIO_FS VirtioFs,
IN UINT64  DirNodeId,
IN CHAR8 *  Name,
OUT UINT64 *  NodeId,
OUT UINT64 *  FuseHandle 
)

Create a directory.

Parameters
[in,out]VirtioFsThe Virtio Filesystem device on which the directory should be created.
[in]DirNodeIdThe inode number of the immediate parent directory of the directory to create.
[in]NameThe single-component filename of the directory to create, under the immediate parent directory identified by DirNodeId.
[out]NodeIdThe inode number of the directory created, returned by the Virtio Filesystem device.
[out]FuseHandleThe open handle to the directory created, returned by the Virtio Filesystem device.
Return values
EFI_SUCCESSThe directory has been created successfully.
Returns
Errors propagated from underlying functions.

Definition at line 234 of file SimpleFsOpen.c.

◆ CreateRegularFile()

STATIC EFI_STATUS CreateRegularFile ( IN OUT VIRTIO_FS VirtioFs,
IN UINT64  DirNodeId,
IN CHAR8 *  Name,
OUT UINT64 *  NodeId,
OUT UINT64 *  FuseHandle 
)

Create a regular file.

Parameters
[in,out]VirtioFsThe Virtio Filesystem device on which the regular file should be created.
[in]DirNodeIdThe inode number of the immediate parent directory of the regular file to create.
[in]NameThe single-component filename of the regular file to create, under the immediate parent directory identified by DirNodeId.
[out]NodeIdThe inode number of the regular file created, returned by the Virtio Filesystem device.
[out]FuseHandleThe open handle to the regular file created, returned by the Virtio Filesystem device.
Return values
EFI_SUCCESSThe regular file has been created successfully.
Returns
Errors propagated from underlying functions.

Definition at line 291 of file SimpleFsOpen.c.

◆ OpenExistentFileOrDirectory()

STATIC EFI_STATUS OpenExistentFileOrDirectory ( IN OUT VIRTIO_FS VirtioFs,
IN UINT64  DirNodeId,
IN CHAR8 *  Name,
IN BOOLEAN  OpenForWriting,
OUT UINT64 *  NodeId,
OUT UINT64 *  FuseHandle,
OUT BOOLEAN *  NodeIsDirectory 
)

Open an existent regular file or non-root directory.

Parameters
[in,out]VirtioFsThe Virtio Filesystem device on which the regular file or directory should be opened.
[in]DirNodeIdThe inode number of the immediate parent directory of the regular file or directory to open.
[in]NameThe single-component filename of the regular file or directory to open, under the immediate parent directory identified by DirNodeId.
[in]OpenForWritingTRUE if the regular file or directory should be opened for read-write access. FALSE if the regular file or directory should be opened for read-only access. Opening a directory for read-write access is useful for deleting, renaming, syncing or touching the directory later.
[out]NodeIdThe inode number of the regular file or directory, returned by the Virtio Filesystem device.
[out]FuseHandleThe open handle to the regular file or directory, returned by the Virtio Filesystem device.
[out]NodeIsDirectorySet to TRUE on output if Name was found to refer to a directory. Set to FALSE if Name was found to refer to a regular file.
Return values
EFI_SUCCESSThe regular file or directory has been looked up and opened successfully.
EFI_ACCESS_DENIEDOpenForWriting is TRUE, but the regular file or directory is marked read-only.
EFI_NOT_FOUNDA directory entry called Name was not found in the directory identified by DirNodeId. (EFI_NOT_FOUND is not returned for any other condition.)
Returns
Errors propagated from underlying functions. If the error code to propagate were EFI_NOT_FOUND, it is remapped to EFI_DEVICE_ERROR.

Definition at line 139 of file SimpleFsOpen.c.

◆ OpenRootDirectory()

STATIC EFI_STATUS OpenRootDirectory ( IN OUT VIRTIO_FS VirtioFs,
OUT EFI_FILE_PROTOCOL **  NewHandle,
IN BOOLEAN  OpenForWriting 
)

Open the root directory, possibly for writing.

Parameters
[in,out]VirtioFsThe Virtio Filesystem device whose root directory should be opened.
[out]NewHandleThe new EFI_FILE_PROTOCOL instance through which the root directory can be accessed.
[in]OpenForWritingTRUE if the root directory should be opened for read-write access. FALSE if the root directory should be opened for read-only access. Opening the root directory for read-write access is useful for calling EFI_FILE_PROTOCOL.Flush() or EFI_FILE_PROTOCOL.SetInfo() later, for syncing or touching the root directory, respectively.
Return values
EFI_SUCCESSThe root directory has been opened successfully.
EFI_ACCESS_DENIEDOpenForWriting is TRUE, but the root directory is marked as read-only.
Returns
Error codes propagated from underlying functions.

Definition at line 40 of file SimpleFsOpen.c.

◆ VirtioFsSimpleFileOpen()

EFI_STATUS EFIAPI VirtioFsSimpleFileOpen ( IN EFI_FILE_PROTOCOL This,
OUT EFI_FILE_PROTOCOL **  NewHandle,
IN CHAR16 *  FileName,
IN UINT64  OpenMode,
IN UINT64  Attributes 
)

Definition at line 310 of file SimpleFsOpen.c.