[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 30/72] raw-posix: Fix build without is_allocated sup
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PATCH 30/72] raw-posix: Fix build without is_allocated support |
Date: |
Sun, 24 Jun 2012 01:06:54 +0200 |
From: Kevin Wolf <address@hidden>
Move the declaration of s into the #ifdef sections that actually make
use of it.
Signed-off-by: Kevin Wolf <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
block/raw-posix.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/block/raw-posix.c b/block/raw-posix.c
index bf7700a..0dce089 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -606,7 +606,6 @@ static int coroutine_fn
raw_co_is_allocated(BlockDriverState *bs,
int64_t sector_num,
int nb_sectors, int *pnum)
{
- BDRVRawState *s = bs->opaque;
off_t start, data, hole;
int ret;
@@ -616,11 +615,15 @@ static int coroutine_fn
raw_co_is_allocated(BlockDriverState *bs,
}
start = sector_num * BDRV_SECTOR_SIZE;
+
#ifdef CONFIG_FIEMAP
+
+ BDRVRawState *s = bs->opaque;
struct {
struct fiemap fm;
struct fiemap_extent fe;
} f;
+
f.fm.fm_start = start;
f.fm.fm_length = (int64_t)nb_sectors * BDRV_SECTOR_SIZE;
f.fm.fm_flags = 0;
@@ -643,7 +646,11 @@ static int coroutine_fn
raw_co_is_allocated(BlockDriverState *bs,
data = f.fe.fe_logical;
hole = f.fe.fe_logical + f.fe.fe_length;
}
+
#elif defined SEEK_HOLE && defined SEEK_DATA
+
+ BDRVRawState *s = bs->opaque;
+
hole = lseek(s->fd, start, SEEK_HOLE);
if (hole == -1) {
/* -ENXIO indicates that sector_num was past the end of the file.
--
1.6.0.2
- [Qemu-devel] [PATCH 11/72] ppc: Avoid AREG0 for MMU etc. helpers, (continued)
- [Qemu-devel] [PATCH 11/72] ppc: Avoid AREG0 for MMU etc. helpers, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 09/72] ppc: Avoid AREG0 for integer and vector helpers, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 18/72] ppc: Avoid AREG0 for misc helpers, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 21/72] ppc: Add missing break, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 20/72] ppc: Move load and store helpers, switch to AREG0 free mode, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 06/72] ppc: Split FPU and SPE ops, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 25/72] booke_206_tlbwe: Discard invalid bits in MAS2, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 24/72] Avoid segfault in cpu_dump_state, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 23/72] PPC: mpc8544ds: Span initial TLB entry over as much RAM as we need, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 28/72] spapr_vscsi: Error handling fixes, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 30/72] raw-posix: Fix build without is_allocated support,
Alexander Graf <=
- [Qemu-devel] [PATCH 31/72] dt: allow add_subnode to create root subnodes, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 33/72] dt: add helper for phandle references, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 29/72] spapr: Add "memop" hypercall, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 32/72] dt: add helpers for multi-cell adds, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 01/72] ppc: Fix coding style in op_helper.c, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 08/72] ppc: Split integer and vector ops, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 26/72] ppc64: Rudimentary Support for extra page sizes on server CPUs, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 37/72] dt: add helper for phandle allocation, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 38/72] dt: add helper for 64bit cell adds, Alexander Graf, 2012/06/23
- [Qemu-devel] [PATCH 34/72] dt: temporarily disable subtree creation failure check, Alexander Graf, 2012/06/23