TianoCore EDK2 master
Loading...
Searching...
No Matches
FuseRename.c File Reference
#include <Library/BaseLib.h>
#include "VirtioFsDxe.h"

Go to the source code of this file.

Functions

EFI_STATUS VirtioFsFuseRename (IN OUT VIRTIO_FS *VirtioFs, IN UINT64 OldParentNodeId, IN CHAR8 *OldName, IN UINT64 NewParentNodeId, IN CHAR8 *NewName)
 

Detailed Description

FUSE_RENAME2 wrapper for the Virtio Filesystem device.

Copyright (C) 2020, Red Hat, Inc.

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

Definition in file FuseRename.c.

Function Documentation

◆ VirtioFsFuseRename()

EFI_STATUS VirtioFsFuseRename ( IN OUT VIRTIO_FS VirtioFs,
IN UINT64  OldParentNodeId,
IN CHAR8 *  OldName,
IN UINT64  NewParentNodeId,
IN CHAR8 *  NewName 
)

Rename a regular file or a directory, by sending the FUSE_RENAME2 request to the Virtio Filesystem device. If the new filename exists, the request will fail.

The function may only be called after VirtioFsFuseInitSession() returns successfully and before VirtioFsUninit() is called.

Parameters
[in,out]VirtioFsThe Virtio Filesystem device to send the FUSE_RENAME2 request to. On output, the FUSE request counter "VirtioFs->RequestId" will have been incremented.
[in]OldParentNodeIdThe inode number of the directory in which OldName should be removed.
[in]OldNameThe single-component filename to remove in the directory identified by OldParentNodeId.
[in]NewParentNodeIdThe inode number of the directory in which NewName should be created, such that on successful return, (NewParentNodeId, NewName) refer to the same inode as (OldParentNodeId, OldName) did on entry.
[in]NewNameThe single-component filename to create in the directory identified by NewParentNodeId.
Return values
EFI_SUCCESSThe file or directory has been renamed.
Returns
The "errno" value mapped to an EFI_STATUS code, if the Virtio Filesystem device explicitly reported an error.
Error codes propagated from VirtioFsSgListsValidate(), VirtioFsFuseNewRequest(), VirtioFsSgListsSubmit(), VirtioFsFuseCheckResponse().

Definition at line 51 of file FuseRename.c.