On 1/26/21 4:07 AM, Richard W.M. Jones wrote:
There's no point flushing the overlay - a temporary file which
has
been deleted and is discarded as soon as nbdkit exits. We can gain
some performance by avoiding pointlessly flushing the overlay to disk.
I also changed can_fua to return NBDKIT_FUA_NATIVE so that
NBDKIT_FLAG_FUA is actually being set, rather than nbdkit emulating it
with a call to .flush.
---
filters/cow/blk.h | 3 ---
filters/cow/blk.c | 19 ++-----------------
filters/cow/cow.c | 19 +++++++------------
3 files changed, 9 insertions(+), 32 deletions(-)
+++ b/filters/cow/blk.c
@@ -54,9 +54,8 @@
* When writing a block we unconditionally write the data to the
* temporary file, setting the bit in the bitmap.
*
- * We allow the client to request FUA, and emulate it with a flush
- * (arguably, since the write overlay is temporary, we could ignore
- * FUA altogether).
+ * Since the overlay is a deleted temporary file, we can ignore FUA
+ * and flush commands.
The comment is correct, and the patch implements what the comment suggested.
LGTM
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization:
qemu.org |
libvirt.org