Re: [PATCH] Generic compat_sys_fallocate

From: Heiko Carstens
Date: Fri Sep 28 2007 - 15:35:42 EST


On Fri, Sep 28, 2007 at 02:11:11PM -0400, Kyle McMartin wrote:
> Basically everyone is using the same sys32_fallocate. Delete a whole bunch of
> archdep code and move the compat wrapper to fs/compat.c
>
> Signed-off-by: Kyle McMartin <kyle@xxxxxxxxxxx>
> --- a/arch/sparc64/kernel/sys_sparc32.c
> +++ b/arch/sparc64/kernel/sys_sparc32.c
> @@ -1028,9 +1028,3 @@ long compat_sync_file_range(int fd, unsigned long off_high, unsigned long off_lo
> flags);
> }
>
> -asmlinkage long compat_sys_fallocate(int fd, int mode, u32 offhi, u32 offlo,
> - u32 lenhi, u32 lenlo)
> -{
> - return sys_fallocate(fd, mode, ((loff_t)offhi << 32) | offlo,
> - ((loff_t)lenhi << 32) | lenlo);
> -}
> diff --git a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c
> index bee96d6..ca8deac 100644
> --- a/arch/x86_64/ia32/sys_ia32.c
> +++ b/arch/x86_64/ia32/sys_ia32.c
> @@ -880,10 +880,3 @@ asmlinkage long sys32_fadvise64(int fd, unsigned offset_lo, unsigned offset_hi,
> len, advice);
> }
>
> -asmlinkage long sys32_fallocate(int fd, int mode, unsigned offset_lo,
> - unsigned offset_hi, unsigned len_lo,
> - unsigned len_hi)
> -{
> - return sys_fallocate(fd, mode, ((u64)offset_hi << 32) | offset_lo,
> - ((u64)len_hi << 32) | len_lo);
> -}

These are not identical... the least and most significant parts seem to get
passed in a different way on little and big endian machines.
Maybe it would be worth to have something like compat_merge_64() which does
the right thing?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/