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>
This commit is contained in:
@@ -189,7 +189,7 @@ SYSCALL_SPU(getcwd)
|
||||
SYSCALL_SPU(capget)
|
||||
SYSCALL_SPU(capset)
|
||||
COMPAT_SYS(sigaltstack)
|
||||
SYSX_SPU(sys_sendfile64,compat_sys_sendfile,sys_sendfile)
|
||||
SYSX_SPU(sys_sendfile,compat_sys_sendfile_wrapper,sys_sendfile)
|
||||
SYSCALL(ni_syscall)
|
||||
SYSCALL(ni_syscall)
|
||||
PPC_SYS(vfork)
|
||||
@@ -229,7 +229,7 @@ COMPAT_SYS_SPU(sched_setaffinity)
|
||||
COMPAT_SYS_SPU(sched_getaffinity)
|
||||
SYSCALL(ni_syscall)
|
||||
SYSCALL(ni_syscall)
|
||||
SYS32ONLY(sendfile64)
|
||||
SYSX(sys_ni_syscall,compat_sys_sendfile64_wrapper,sys_sendfile64)
|
||||
COMPAT_SYS_SPU(io_setup)
|
||||
SYSCALL_SPU(io_destroy)
|
||||
COMPAT_SYS_SPU(io_getevents)
|
||||
|
Reference in New Issue
Block a user