diff mbox series

[v5,3/3] block/io: Merge discard request alignments

Message ID 20210705130458.97642-3-akihiko.odaki@gmail.com (mailing list archive)
State New, archived
Headers show
Series [v5,1/3] block/file-posix: Optimize for macOS | expand

Commit Message

Akihiko Odaki July 5, 2021, 1:04 p.m. UTC
Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
---
 block/io.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/block/io.c b/block/io.c
index 323854d0633..db19ae2bd9c 100644
--- a/block/io.c
+++ b/block/io.c
@@ -125,6 +125,8 @@  void bdrv_parent_drained_begin_single(BdrvChild *c, bool poll)
 
 static void bdrv_merge_limits(BlockLimits *dst, const BlockLimits *src)
 {
+    dst->pdiscard_alignment = MAX(dst->pdiscard_alignment,
+                                  src->pdiscard_alignment);
     dst->opt_transfer = MAX(dst->opt_transfer, src->opt_transfer);
     dst->max_transfer = MIN_NON_ZERO(dst->max_transfer, src->max_transfer);
     dst->opt_mem_alignment = MAX(dst->opt_mem_alignment,