summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/VirtioFsDxe/FuseOpen.c
diff options
context:
space:
mode:
Diffstat (limited to 'OvmfPkg/VirtioFsDxe/FuseOpen.c')
-rw-r--r--OvmfPkg/VirtioFsDxe/FuseOpen.c55
1 files changed, 34 insertions, 21 deletions
diff --git a/OvmfPkg/VirtioFsDxe/FuseOpen.c b/OvmfPkg/VirtioFsDxe/FuseOpen.c
index b731580729..64015bb6cc 100644
--- a/OvmfPkg/VirtioFsDxe/FuseOpen.c
+++ b/OvmfPkg/VirtioFsDxe/FuseOpen.c
@@ -38,21 +38,21 @@
**/
EFI_STATUS
VirtioFsFuseOpen (
- IN OUT VIRTIO_FS *VirtioFs,
- IN UINT64 NodeId,
- IN BOOLEAN ReadWrite,
- OUT UINT64 *FuseHandle
+ IN OUT VIRTIO_FS *VirtioFs,
+ IN UINT64 NodeId,
+ IN BOOLEAN ReadWrite,
+ OUT UINT64 *FuseHandle
)
{
- VIRTIO_FS_FUSE_REQUEST CommonReq;
- VIRTIO_FS_FUSE_OPEN_REQUEST OpenReq;
- VIRTIO_FS_IO_VECTOR ReqIoVec[2];
- VIRTIO_FS_SCATTER_GATHER_LIST ReqSgList;
- VIRTIO_FS_FUSE_RESPONSE CommonResp;
- VIRTIO_FS_FUSE_OPEN_RESPONSE OpenResp;
- VIRTIO_FS_IO_VECTOR RespIoVec[2];
- VIRTIO_FS_SCATTER_GATHER_LIST RespSgList;
- EFI_STATUS Status;
+ VIRTIO_FS_FUSE_REQUEST CommonReq;
+ VIRTIO_FS_FUSE_OPEN_REQUEST OpenReq;
+ VIRTIO_FS_IO_VECTOR ReqIoVec[2];
+ VIRTIO_FS_SCATTER_GATHER_LIST ReqSgList;
+ VIRTIO_FS_FUSE_RESPONSE CommonResp;
+ VIRTIO_FS_FUSE_OPEN_RESPONSE OpenResp;
+ VIRTIO_FS_IO_VECTOR RespIoVec[2];
+ VIRTIO_FS_SCATTER_GATHER_LIST RespSgList;
+ EFI_STATUS Status;
//
// Set up the scatter-gather lists.
@@ -82,8 +82,13 @@ VirtioFsFuseOpen (
//
// Populate the common request header.
//
- Status = VirtioFsFuseNewRequest (VirtioFs, &CommonReq, ReqSgList.TotalSize,
- VirtioFsFuseOpOpen, NodeId);
+ Status = VirtioFsFuseNewRequest (
+ VirtioFs,
+ &CommonReq,
+ ReqSgList.TotalSize,
+ VirtioFsFuseOpOpen,
+ NodeId
+ );
if (EFI_ERROR (Status)) {
return Status;
}
@@ -91,9 +96,9 @@ VirtioFsFuseOpen (
//
// Populate the FUSE_OPEN-specific fields.
//
- OpenReq.Flags = (ReadWrite ?
- VIRTIO_FS_FUSE_OPEN_REQ_F_RDWR :
- VIRTIO_FS_FUSE_OPEN_REQ_F_RDONLY);
+ OpenReq.Flags = (ReadWrite ?
+ VIRTIO_FS_FUSE_OPEN_REQ_F_RDWR :
+ VIRTIO_FS_FUSE_OPEN_REQ_F_RDONLY);
OpenReq.Unused = 0;
//
@@ -110,11 +115,19 @@ VirtioFsFuseOpen (
Status = VirtioFsFuseCheckResponse (&RespSgList, CommonReq.Unique, NULL);
if (EFI_ERROR (Status)) {
if (Status == EFI_DEVICE_ERROR) {
- DEBUG ((DEBUG_ERROR, "%a: Label=\"%s\" NodeId=%Lu ReadWrite=%d "
- "Errno=%d\n", __FUNCTION__, VirtioFs->Label, NodeId, ReadWrite,
- CommonResp.Error));
+ DEBUG ((
+ DEBUG_ERROR,
+ "%a: Label=\"%s\" NodeId=%Lu ReadWrite=%d "
+ "Errno=%d\n",
+ __FUNCTION__,
+ VirtioFs->Label,
+ NodeId,
+ ReadWrite,
+ CommonResp.Error
+ ));
Status = VirtioFsErrnoToEfiStatus (CommonResp.Error);
}
+
return Status;
}