From 6f7bc7196ff2d7174fec382d66aa5dfea31a7026 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Wed, 16 Dec 2020 22:11:15 +0100 Subject: OvmfPkg/VirtioFsDxe: implement the wrapper function for FUSE_WRITE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the VirtioFsFuseWrite() function, for sending the FUSE_WRITE command to the Virtio Filesystem device. (For avoiding oversized FUSE_WRITE commands, save the maximum write buffer size that is advertized by the FUSE server, in the session init code.) Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Philippe Mathieu-Daudé Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3097 Signed-off-by: Laszlo Ersek Message-Id: <20201216211125.19496-39-lersek@redhat.com> Acked-by: Ard Biesheuvel --- OvmfPkg/Include/IndustryStandard/VirtioFs.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'OvmfPkg/Include') diff --git a/OvmfPkg/Include/IndustryStandard/VirtioFs.h b/OvmfPkg/Include/IndustryStandard/VirtioFs.h index fa8c40019f..0b7b3ff80e 100644 --- a/OvmfPkg/Include/IndustryStandard/VirtioFs.h +++ b/OvmfPkg/Include/IndustryStandard/VirtioFs.h @@ -153,6 +153,7 @@ typedef enum { VirtioFsFuseOpRmDir = 11, VirtioFsFuseOpOpen = 14, VirtioFsFuseOpRead = 15, + VirtioFsFuseOpWrite = 16, VirtioFsFuseOpStatFs = 17, VirtioFsFuseOpRelease = 18, VirtioFsFuseOpFsync = 20, @@ -282,6 +283,24 @@ typedef struct { UINT32 Padding; } VIRTIO_FS_FUSE_READ_REQUEST; +// +// Headers for VirtioFsFuseOpWrite. +// +typedef struct { + UINT64 FileHandle; + UINT64 Offset; + UINT32 Size; + UINT32 WriteFlags; + UINT64 LockOwner; + UINT32 Flags; + UINT32 Padding; +} VIRTIO_FS_FUSE_WRITE_REQUEST; + +typedef struct { + UINT32 Size; + UINT32 Padding; +} VIRTIO_FS_FUSE_WRITE_RESPONSE; + // // Header for VirtioFsFuseOpStatFs. // -- cgit v1.2.3