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

@@ -78,6 +78,7 @@ typedef struct {
VRING Ring; // VirtioRingInit 2
VOID *RingMap; // VirtioRingMap 2
UINT64 RequestId; // FuseInitSession 1
UINT32 MaxWrite; // FuseInitSession 1
EFI_EVENT ExitBoot; // DriverBindingStart 0
LIST_ENTRY OpenFiles; // DriverBindingStart 0
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL SimpleFs; // DriverBindingStart 0
@@ -334,6 +335,16 @@ VirtioFsFuseReadFileOrDir (
OUT VOID *Data
);
EFI_STATUS
VirtioFsFuseWrite (
IN OUT VIRTIO_FS *VirtioFs,
IN UINT64 NodeId,
IN UINT64 FuseHandle,
IN UINT64 Offset,
IN OUT UINT32 *Size,
IN VOID *Data
);
EFI_STATUS
VirtioFsFuseStatFs (
IN OUT VIRTIO_FS *VirtioFs,