On 21.10.20 16:58, Vladimir Sementsov-Ogievskiy wrote:
It's intended to be inserted between format and protocol nodes to
preallocate additional space (expanding protocol file) on writes
crossing EOF. It improves performance for file-systems with slow
allocation.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
docs/system/qemu-block-drivers.rst.inc | 26 ++
qapi/block-core.json | 20 +-
block/preallocate.c | 559 +++++++++++++++++++++++++
block/meson.build | 1 +
4 files changed, 605 insertions(+), 1 deletion(-)
create mode 100644 block/preallocate.c
[...]
+ if (end <= s->file_end) {
+ /* No preallocation needed. */
+ return want_merge_zero && offset >= s->zero_start;
+ }
+
+ /* Now we want new preallocation, as request writes beyond s->data_end. */
True, but isn’t s->file_end more important?