diff options
author | Laszlo Ersek <lersek@redhat.com> | 2020-12-16 22:11:08 +0100 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-12-21 17:16:23 +0000 |
commit | c4edb49b4f074f8d22a9c5e8f337dc29658de01c (patch) | |
tree | 7c8c1dc9c66994aa9f1b62da261722e8124bc89c /OvmfPkg/VirtioFsDxe/SimpleFsGetPosition.c | |
parent | b6b240f94f586126afce661f89871fecfff7d12a (diff) | |
download | edk2-c4edb49b4f074f8d22a9c5e8f337dc29658de01c.tar.gz |
OvmfPkg/VirtioFsDxe: implement EFI_FILE_PROTOCOL.GetPosition, .SetPosition
Using the functions introduced previously, we can now implement
VirtioFsSimpleFileGetPosition() and VirtioFsSimpleFileSetPosition().
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-32-lersek@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Diffstat (limited to 'OvmfPkg/VirtioFsDxe/SimpleFsGetPosition.c')
-rw-r--r-- | OvmfPkg/VirtioFsDxe/SimpleFsGetPosition.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/OvmfPkg/VirtioFsDxe/SimpleFsGetPosition.c b/OvmfPkg/VirtioFsDxe/SimpleFsGetPosition.c index 2f40d2be26..53212621e9 100644 --- a/OvmfPkg/VirtioFsDxe/SimpleFsGetPosition.c +++ b/OvmfPkg/VirtioFsDxe/SimpleFsGetPosition.c @@ -16,5 +16,12 @@ VirtioFsSimpleFileGetPosition ( OUT UINT64 *Position
)
{
- return EFI_DEVICE_ERROR;
+ VIRTIO_FS_FILE *VirtioFsFile;
+
+ VirtioFsFile = VIRTIO_FS_FILE_FROM_SIMPLE_FILE (This);
+ if (VirtioFsFile->IsDirectory) {
+ return EFI_UNSUPPORTED;
+ }
+ *Position = VirtioFsFile->FilePosition;
+ return EFI_SUCCESS;
}
|