From patchwork Sun Jan 9 17:47:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 78041 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CD6C7B7138 for ; Mon, 10 Jan 2011 04:49:20 +1100 (EST) Received: from localhost ([127.0.0.1]:40432 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PbzNq-000053-Ay for incoming@patchwork.ozlabs.org; Sun, 09 Jan 2011 12:48:50 -0500 Received: from [140.186.70.92] (port=36864 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PbzMk-0007mU-RU for qemu-devel@nongnu.org; Sun, 09 Jan 2011 12:47:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PbzMS-0002LR-1y for qemu-devel@nongnu.org; Sun, 09 Jan 2011 12:47:25 -0500 Received: from afflict.kos.to ([92.243.29.197]:52354) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PbzMR-0002JS-Jd for qemu-devel@nongnu.org; Sun, 09 Jan 2011 12:47:24 -0500 Received: from [192.168.0.44] (a91-156-61-161.elisa-laajakaista.fi [91.156.61.161]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by afflict.kos.to (Postfix) with ESMTPSA id 822BA26589; Sun, 9 Jan 2011 17:47:13 +0000 (UTC) Message-ID: <4D29F4A0.1050500@iki.fi> Date: Sun, 09 Jan 2011 19:47:12 +0200 From: riku voipio User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 To: Blue Swirl Subject: Re: [Qemu-devel] [PATCH 3/7] linux-user: Implement FS_IOC_FIEMAP ioctl References: <285da2b9a83353703d07e141fdb447e82944146c.1294433287.git.riku.voipio@nokia.com> In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Peter Maydell , qemu-devel@nongnu.org X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On 01/09/2011 04:47 PM, Blue Swirl wrote: > This fails if the file doesn't exist: > CC i386-linux-user/syscall.o > /src/qemu/linux-user/syscall.c:86:26: error: linux/fiemap.h: No such > file or directory > The fix is to introduce a feature check in configure. Perhaps we can do without configure check, since FS_IOC_FIEMAP is defined in fs.h if fiemap.h is available. See the attached patch. Acked-by: Blue Swirl From 8c186f5698ce2fa0a3f6faf11122ee0b69d388c8 Mon Sep 17 00:00:00 2001 From: Riku Voipio Date: Sun, 9 Jan 2011 19:37:10 +0200 Subject: [PATCH] linux-user: guard fiemap with FS_IOC_FIEMAP Compilation of linux-user fails if the file doesn't exist: CC i386-linux-user/syscall.o /src/qemu/linux-user/syscall.c:86:26: error: linux/fiemap.h: No such file or directory Since FS_IOC_FIEMAP is defined in fs.h, we can use it #ifdef fiemap support out Signed-off-by: Riku Voipio --- linux-user/syscall.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index f10e17a..c1f506c 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -83,7 +83,9 @@ int __clone2(int (*fn)(void *), void *child_stack_base, #include #include #include +#if defined(FS_IOC_FIEMAP) #include +#endif #include #include #include "linux_loop.h" @@ -2986,6 +2988,7 @@ struct IOCTLEntry { #define MAX_STRUCT_SIZE 4096 +#ifdef FS_IOC_FIEMAP /* So fiemap access checks don't overflow on 32 bit systems. * This is very slightly smaller than the limit imposed by * the underlying kernel. @@ -3072,6 +3075,7 @@ static abi_long do_ioctl_fs_ioc_fiemap(const IOCTLEntry *ie, uint8_t *buf_temp, } return ret; } +#endif /* FS_IOC_FIEMAP */ static IOCTLEntry ioctl_entries[] = { #define IOCTL(cmd, access, ...) \ -- 1.7.1