compat: fs: Generic compat_sys_sendfile implementation
This function is used by sparc, powerpc and arm64 for compat support. The patch adds a generic implementation which calls do_sendfile() directly and avoids set_fs(). The sparc architecture has wrappers for the sign extensions while powerpc relies on the compiler to do the this. The patch adds wrappers for powerpc to handle the u32->int type conversion. compat_sys_sendfile64() can be replaced by a sys_sendfile() call since compat_loff_t has the same size as off_t on a 64-bit system. On powerpc, the patch also changes the 64-bit sendfile call from sys_sendile64 to sys_sendfile. Signed-off-by:Catalin Marinas <catalin.marinas@arm.com> Acked-by:
David S. Miller <davem@davemloft.net> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
Showing
- arch/powerpc/include/asm/systbl.h 2 additions, 2 deletionsarch/powerpc/include/asm/systbl.h
- arch/powerpc/include/asm/unistd.h 1 addition, 0 deletionsarch/powerpc/include/asm/unistd.h
- arch/powerpc/kernel/sys_ppc32.c 7 additions, 38 deletionsarch/powerpc/kernel/sys_ppc32.c
- arch/sparc/include/asm/unistd.h 1 addition, 0 deletionsarch/sparc/include/asm/unistd.h
- arch/sparc/kernel/sys32.S 1 addition, 1 deletionarch/sparc/kernel/sys32.S
- arch/sparc/kernel/sys_sparc32.c 0 additions, 46 deletionsarch/sparc/kernel/sys_sparc32.c
- fs/compat.c 22 additions, 0 deletionsfs/compat.c
- fs/read_write.c 2 additions, 2 deletionsfs/read_write.c
- fs/read_write.h 2 additions, 0 deletionsfs/read_write.h
- include/linux/compat.h 3 additions, 0 deletionsinclude/linux/compat.h
Please register or sign in to comment