diff options
author | Laszlo Ersek <lersek@redhat.com> | 2020-12-16 22:11:12 +0100 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-12-21 17:16:23 +0000 |
commit | b845de89d02b9822d184179c622e6517e8477827 (patch) | |
tree | 51be37fef33f9987bf8eaa15b799a0e53b75d91a /OvmfPkg/VirtioFsDxe/SimpleFsClose.c | |
parent | 7a7752095c172b381595da5247071635c7e496d5 (diff) | |
download | edk2-b845de89d02b9822d184179c622e6517e8477827.tar.gz edk2-b845de89d02b9822d184179c622e6517e8477827.tar.bz2 edk2-b845de89d02b9822d184179c622e6517e8477827.zip |
OvmfPkg/VirtioFsDxe: add EFI_FILE_INFO cache fields to VIRTIO_FS_FILE
For reading through a directory stream with tolerable performance, we'll
have to call FUSE_READDIRPLUS each time with such a buffer that can
deliver a good number of variable size records
(VIRTIO_FS_FUSE_DIRENTPLUS_RESPONSE elements). Every time we'll do that,
we'll turn the whole bunch into an array of EFI_FILE_INFOs immediately.
EFI_FILE_PROTOCOL.Read() invocations (on directories) will be served from
this EFI_FILE_INFO cache.
Add the fields for the EFI_FILE_INFO cache to VIRTIO_FS_FILE:
- initialize them in Open() and OpenVolume(),
- release the cache in Close() and Delete(),
- also release the cache when the directory is rewound, in SetPosition().
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-36-lersek@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Diffstat (limited to 'OvmfPkg/VirtioFsDxe/SimpleFsClose.c')
-rw-r--r-- | OvmfPkg/VirtioFsDxe/SimpleFsClose.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/OvmfPkg/VirtioFsDxe/SimpleFsClose.c b/OvmfPkg/VirtioFsDxe/SimpleFsClose.c index 04b4f2c382..4c1cf52112 100644 --- a/OvmfPkg/VirtioFsDxe/SimpleFsClose.c +++ b/OvmfPkg/VirtioFsDxe/SimpleFsClose.c @@ -60,6 +60,9 @@ VirtioFsSimpleFileClose ( RemoveEntryList (&VirtioFsFile->OpenFilesEntry);
FreePool (VirtioFsFile->CanonicalPathname);
+ if (VirtioFsFile->FileInfoArray != NULL) {
+ FreePool (VirtioFsFile->FileInfoArray);
+ }
FreePool (VirtioFsFile);
return EFI_SUCCESS;
}
|