[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/17] block: Improve documentation of .bdrv_has_zero_init
From: |
Eric Blake |
Subject: |
[PATCH 04/17] block: Improve documentation of .bdrv_has_zero_init |
Date: |
Fri, 31 Jan 2020 11:44:23 -0600 |
Several drivers supply .bdrv_has_zero_init that returns 1, but lack
the .bdrv_has_zero_init_truncate callback (parallels and qed outright,
vdi in some scenarios). A literal reading of the existing
documentation says such drivers are broken, because
bdrv_has_zero_init_truncate() defaults to zero if the callback is
missing; but in practice, the tie between the two functions is only
relevant when truncate is supported. Clarify the documentation to
make it obvious that this is okay.
Fixes: 1dcaf527
Signed-off-by: Eric Blake <address@hidden>
---
include/block/block_int.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 640fb82c789e..77ab45dc87cf 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -444,7 +444,8 @@ struct BlockDriver {
/*
* Returns 1 if newly created images are guaranteed to contain only
* zeros, 0 otherwise.
- * Must return 0 if .bdrv_has_zero_init_truncate() returns 0.
+ * Must return 0 if .bdrv_co_truncate is set and
+ * .bdrv_has_zero_init_truncate() returns 0.
*/
int (*bdrv_has_zero_init)(BlockDriverState *bs);
--
2.24.1
- [PATCH 00/17] Improve qcow2 all-zero detection, Eric Blake, 2020/01/31
- [PATCH 04/17] block: Improve documentation of .bdrv_has_zero_init,
Eric Blake <=
- [PATCH 01/17] qcow2: Comment typo fixes, Eric Blake, 2020/01/31
- [PATCH 02/17] qcow2: List autoclear bit names in header, Eric Blake, 2020/01/31
- [PATCH 07/17] gluster: Drop useless has_zero_init callback, Eric Blake, 2020/01/31
- [PATCH 06/17] block: Improve bdrv_has_zero_init_truncate with backing file, Eric Blake, 2020/01/31
- [PATCH 05/17] block: Don't advertise zero_init_truncate with encryption, Eric Blake, 2020/01/31
- [PATCH 03/17] qcow2: Avoid feature name extension on small cluster size, Eric Blake, 2020/01/31
- [PATCH 08/17] sheepdog: Consistently set bdrv_has_zero_init_truncate, Eric Blake, 2020/01/31
- [PATCH 10/17] block: Add new BDRV_ZERO_OPEN flag, Eric Blake, 2020/01/31
- [PATCH 11/17] file-posix: Support BDRV_ZERO_OPEN, Eric Blake, 2020/01/31