Commit d2610202 authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] x86_64: Add compat_sys_vmsplice and use it in x86-64

Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 5e7dd2ab
...@@ -695,4 +695,5 @@ ia32_sys_call_table: ...@@ -695,4 +695,5 @@ ia32_sys_call_table:
.quad sys_splice .quad sys_splice
.quad sys_sync_file_range .quad sys_sync_file_range
.quad sys_tee .quad sys_tee
.quad compat_sys_vmsplice
ia32_syscall_end: ia32_syscall_end:
...@@ -1317,6 +1317,26 @@ compat_sys_writev(unsigned long fd, const struct compat_iovec __user *vec, unsig ...@@ -1317,6 +1317,26 @@ compat_sys_writev(unsigned long fd, const struct compat_iovec __user *vec, unsig
return ret; return ret;
} }
asmlinkage long
compat_sys_vmsplice(int fd, const struct compat_iovec __user *iov32,
unsigned int nr_segs, unsigned int flags)
{
unsigned i;
struct iovec *iov;
if (nr_segs >= UIO_MAXIOV)
return -EINVAL;
iov = compat_alloc_user_space(nr_segs * sizeof(struct iovec));
for (i = 0; i < nr_segs; i++) {
struct compat_iovec v;
if (get_user(v.iov_base, &iov32[i].iov_base) ||
get_user(v.iov_len, &iov32[i].iov_len) ||
put_user(compat_ptr(v.iov_base), &iov[i].iov_base) ||
put_user(v.iov_len, &iov[i].iov_len))
return -EFAULT;
}
return sys_vmsplice(fd, iov, nr_segs, flags);
}
/* /*
* Exactly like fs/open.c:sys_open(), except that it doesn't set the * Exactly like fs/open.c:sys_open(), except that it doesn't set the
* O_LARGEFILE flag. * O_LARGEFILE flag.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment