OvmfPkg/VirtioFsDxe: implement the wrapper function for FUSE_WRITE

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 <ard.biesheuvel@arm.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3097
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20201216211125.19496-39-lersek@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
This commit is contained in:
Laszlo Ersek
2020-12-16 22:11:15 +01:00
committed by mergify[bot]
parent 867cb9f60c
commit 6f7bc7196f
5 changed files with 196 additions and 2 deletions

View File

@@ -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.
//