summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/VirtioFsDxe/SimpleFsOpenVolume.c
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2020-12-16 22:10:52 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-12-21 17:16:23 +0000
commit28092a3938655be5805dd042a5313ec2b948294a (patch)
tree6396d98c3713fdb36f5c10241253b47177b7d67a /OvmfPkg/VirtioFsDxe/SimpleFsOpenVolume.c
parentd0474399521789646ebc66b3450a4983d6fd07d9 (diff)
downloadedk2-28092a3938655be5805dd042a5313ec2b948294a.tar.gz
edk2-28092a3938655be5805dd042a5313ec2b948294a.tar.bz2
edk2-28092a3938655be5805dd042a5313ec2b948294a.zip
OvmfPkg/VirtioFsDxe: flush, sync, release and forget in Close() / Delete()
The two member functions that free the EFI_FILE_PROTOCOL object are Close() and Delete(). Before we create VIRTIO_FS_FILE objects with EFI_FILE_PROTOCOL.Open() later in this patch series, extend each of these "destructor" functions to get rid of the FuseHandle and NodeId resources properly -- in a way that matches each function's own purpose. For the time being, VirtioFsSimpleFileDelete() only gets a reminder about its core task (namely, removing the file), as the needed machinery will become only later. But we can already outline the "task list", and deal with the FuseHandle and NodeId resources. The "task list" of VirtioFsSimpleFileDelete() is different from that of VirtioFsSimpleFileClose(), thus both destructors diverge at this point. 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-16-lersek@redhat.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Diffstat (limited to 'OvmfPkg/VirtioFsDxe/SimpleFsOpenVolume.c')
-rw-r--r--OvmfPkg/VirtioFsDxe/SimpleFsOpenVolume.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/OvmfPkg/VirtioFsDxe/SimpleFsOpenVolume.c b/OvmfPkg/VirtioFsDxe/SimpleFsOpenVolume.c
index 8c1457a68a..67d2deb6bd 100644
--- a/OvmfPkg/VirtioFsDxe/SimpleFsOpenVolume.c
+++ b/OvmfPkg/VirtioFsDxe/SimpleFsOpenVolume.c
@@ -62,6 +62,7 @@ VirtioFsOpenVolume (
VirtioFsFile->SimpleFile.SetInfo = VirtioFsSimpleFileSetInfo;
VirtioFsFile->SimpleFile.Flush = VirtioFsSimpleFileFlush;
VirtioFsFile->IsDirectory = TRUE;
+ VirtioFsFile->IsOpenForWriting = FALSE;
VirtioFsFile->OwnerFs = VirtioFs;
VirtioFsFile->NodeId = VIRTIO_FS_FUSE_ROOT_DIR_NODE_ID;
VirtioFsFile->FuseHandle = RootDirHandle;