[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/7] linux-user: Implement FS_IOC_FIEMAP ioctl
From: |
Blue Swirl |
Subject: |
Re: [Qemu-devel] [PATCH 3/7] linux-user: Implement FS_IOC_FIEMAP ioctl |
Date: |
Sun, 9 Jan 2011 14:47:19 +0000 |
On Fri, Jan 7, 2011 at 8:52 PM, Riku Voipio <address@hidden> wrote:
> From: Peter Maydell <address@hidden>
>
> Implement the FS_IOC_FIEMAP ioctl using the new support for
> custom handling of ioctls; this is needed because the struct
> that is passed includes a variable-length array.
>
> Signed-off-by: Peter Maydell <address@hidden>
> Signed-off-by: Riku Voipio <address@hidden>
> ---
> linux-user/ioctls.h | 4 ++
> linux-user/syscall.c | 88
> ++++++++++++++++++++++++++++++++++++++++++++
> linux-user/syscall_defs.h | 1 +
> linux-user/syscall_types.h | 16 ++++++++
> 4 files changed, 109 insertions(+), 0 deletions(-)
>
> diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
> index 769e1bc..538e257 100644
> --- a/linux-user/ioctls.h
> +++ b/linux-user/ioctls.h
> @@ -76,6 +76,10 @@
> #ifdef FIGETBSZ
> IOCTL(FIGETBSZ, IOC_R, MK_PTR(TYPE_LONG))
> #endif
> +#ifdef FS_IOC_FIEMAP
> + IOCTL_SPECIAL(FS_IOC_FIEMAP, IOC_W | IOC_R, do_ioctl_fs_ioc_fiemap,
> + MK_PTR(MK_STRUCT(STRUCT_fiemap)))
> +#endif
>
> IOCTL(SIOCATMARK, 0, TYPE_NULL)
> IOCTL(SIOCADDRT, IOC_W, MK_PTR(MK_STRUCT(STRUCT_rtentry)))
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 970efe3..f10e17a 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -83,6 +83,7 @@ int __clone2(int (*fn)(void *), void *child_stack_base,
> #include <linux/kd.h>
> #include <linux/mtio.h>
> #include <linux/fs.h>
> +#include <linux/fiemap.h>
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
/src/qemu/linux-user/syscall.c: In function 'do_ioctl_fs_ioc_fiemap':
/src/qemu/linux-user/syscall.c:3025: error: dereferencing pointer to
incomplete type
/src/qemu/linux-user/syscall.c:3025: error: invalid application of
'sizeof' to incomplete type 'struct fiemap'
/src/qemu/linux-user/syscall.c:3025: error: invalid application of
'sizeof' to incomplete type 'struct fiemap_extent'
cc1: warnings being treated as errors
/src/qemu/linux-user/syscall.c:3025: error: division by zero
/src/qemu/linux-user/syscall.c:3029: error: dereferencing pointer to
incomplete type
/src/qemu/linux-user/syscall.c:3030: error: invalid application of
'sizeof' to incomplete type 'struct fiemap_extent'
/src/qemu/linux-user/syscall.c:3030: error: dereferencing pointer to
incomplete type
/src/qemu/linux-user/syscall.c:3040: error: invalid application of
'sizeof' to incomplete type 'struct fiemap'
/src/qemu/linux-user/syscall.c:3049: error: dereferencing pointer to
incomplete type
/src/qemu/linux-user/syscall.c:3050: error: dereferencing pointer to
incomplete type
/src/qemu/linux-user/syscall.c:3058: error: dereferencing pointer to
incomplete type
/src/qemu/linux-user/syscall.c:3061: error: dereferencing pointer to
incomplete type
/src/qemu/linux-user/syscall.c:3062: error: dereferencing pointer to
incomplete type
The fix is to introduce a feature check in configure.
[Qemu-devel] [PATCH 1/7] linux-user: Implement sync_file_range{, 2} syscalls, Riku Voipio, 2011/01/07
[Qemu-devel] [PATCH 7/7] Remove dead code for ARM semihosting commandline handling, Riku Voipio, 2011/01/07
[Qemu-devel] [PATCH 6/7] Fix commandline handling for ARM semihosted executables, Riku Voipio, 2011/01/07
Re: [Qemu-devel] [PATCH 0/7] linux-user fixes for pull, Aurelien Jarno, 2011/01/08
[Qemu-devel] [PATCH] linux-user: fix for loopmount ioctl, Martin Mohring, 2011/01/08