[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 30/72] raw-posix: Fix build without is_allocated suppo
From: |
Alexander Graf |
Subject: |
[Qemu-ppc] [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-ppc] [PATCH 64/72] uImage: increase the gzip load size, (continued)
- [Qemu-ppc] [PATCH 64/72] uImage: increase the gzip load size, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 13/72] ppc: Move MMU helpers from helper.c to mmu_helper.c, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 62/72] dt: make setprop argument static, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 69/72] PPC: Add e5500 CPU target, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 60/72] dt: Add global option to set phandle start offset, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 58/72] PPC: e500: Define addresses as always 64bit, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 39/72] PPC: e500: require libfdt, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 42/72] PPC: e500: dt: create /hypervisor node dynamically, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 35/72] dt: add helper for phandle enumeration, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 50/72] PPC: e500: dt: start with empty device tree, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 30/72] raw-posix: Fix build without is_allocated support,
Alexander Graf <=
- [Qemu-ppc] [PATCH 68/72] PPC: BookE: Make ivpr selectable by CPU type, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 47/72] PPC: e500: dt: create mpic node dynamically, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 72/72] PPC: BookE206: Bump MAS2 to 64bit, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 71/72] PPC: BookE: Support 32 and 64 bit wide MAS2, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 07/72] ppc: Avoid AREG0 for FPU and SPE helpers, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 63/72] PPC: e500: allow users to set the /compatible property via -machine, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 66/72] PPC: Add support for MSR_CM, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 70/72] PPC: Extract SPR dump generation into its own function, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 52/72] PPC: e500: dt: use 64bit cell helper, Alexander Graf, 2012/06/23
- [Qemu-ppc] [PATCH 10/72] ppc: Split MMU etc. helpers from op_helper.c, Alexander Graf, 2012/06/23