yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
218e99
From e58d84de9cb73fba1b98c57edc63e751b4171c4e Mon Sep 17 00:00:00 2001
218e99
From: Paolo Bonzini <pbonzini@redhat.com>
218e99
Date: Fri, 18 Oct 2013 08:14:45 +0200
218e99
Subject: [PATCH 20/81] raw-posix: report unwritten extents as zero
218e99
218e99
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
218e99
Message-id: <1382084091-16636-21-git-send-email-pbonzini@redhat.com>
218e99
Patchwork-id: 55003
218e99
O-Subject: [RHEL 7.0 qemu-kvm PATCH 20/26] raw-posix: report unwritten extents as zero
218e99
Bugzilla: 989646
218e99
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
218e99
RH-Acked-by: Max Reitz <mreitz@redhat.com>
218e99
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
218e99
218e99
These are created for example with XFS_IOC_ZERO_RANGE.
218e99
218e99
Reviewed-by: Eric Blake <eblake@redhat.com>
218e99
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
218e99
(cherry picked from commit f5f7abcfd50bca38ae278a9c7a3ed60fba3d76dc)
218e99
---
218e99
 block/raw-posix.c | 3 +++
218e99
 1 file changed, 3 insertions(+)
218e99
218e99
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
218e99
---
218e99
 block/raw-posix.c |    3 +++
218e99
 1 files changed, 3 insertions(+), 0 deletions(-)
218e99
218e99
diff --git a/block/raw-posix.c b/block/raw-posix.c
218e99
index a829ce0..c7ab908 100644
218e99
--- a/block/raw-posix.c
218e99
+++ b/block/raw-posix.c
218e99
@@ -1128,6 +1128,9 @@ static int64_t coroutine_fn raw_co_get_block_status(BlockDriverState *bs,
218e99
     } else {
218e99
         data = f.fe.fe_logical;
218e99
         hole = f.fe.fe_logical + f.fe.fe_length;
218e99
+        if (f.fe.fe_flags & FIEMAP_EXTENT_UNWRITTEN) {
218e99
+            ret |= BDRV_BLOCK_ZERO;
218e99
+        }
218e99
     }
218e99
 
218e99
 #elif defined SEEK_HOLE && defined SEEK_DATA
218e99
-- 
218e99
1.7.1
218e99