diff options
author | Andi Kleen <ak@suse.de> | 2006-05-01 15:15:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-05-01 21:17:43 -0400 |
commit | d2610202290b4924b71747314a0f88f28807702e (patch) | |
tree | bdfde16e24caa597f66504d555b06ee2e480ef54 | |
parent | 5e7dd2ab6b9bdfa60e19b8739e6b2a204fd4f477 (diff) |
[PATCH] x86_64: Add compat_sys_vmsplice and use it in x86-64
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | arch/x86_64/ia32/ia32entry.S | 1 | ||||
-rw-r--r-- | fs/compat.c | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/arch/x86_64/ia32/ia32entry.S b/arch/x86_64/ia32/ia32entry.S index 57fc37e0fb9c..5a92fed2d1d5 100644 --- a/arch/x86_64/ia32/ia32entry.S +++ b/arch/x86_64/ia32/ia32entry.S | |||
@@ -695,4 +695,5 @@ ia32_sys_call_table: | |||
695 | .quad sys_splice | 695 | .quad sys_splice |
696 | .quad sys_sync_file_range | 696 | .quad sys_sync_file_range |
697 | .quad sys_tee | 697 | .quad sys_tee |
698 | .quad compat_sys_vmsplice | ||
698 | ia32_syscall_end: | 699 | ia32_syscall_end: |
diff --git a/fs/compat.c b/fs/compat.c index 2e32bd340474..3f3e8f4d43d6 100644 --- a/fs/compat.c +++ b/fs/compat.c | |||
@@ -1317,6 +1317,26 @@ out: | |||
1317 | return ret; | 1317 | return ret; |
1318 | } | 1318 | } |
1319 | 1319 | ||
1320 | asmlinkage long | ||
1321 | compat_sys_vmsplice(int fd, const struct compat_iovec __user *iov32, | ||
1322 | unsigned int nr_segs, unsigned int flags) | ||
1323 | { | ||
1324 | unsigned i; | ||
1325 | struct iovec *iov; | ||
1326 | if (nr_segs >= UIO_MAXIOV) | ||
1327 | return -EINVAL; | ||
1328 | iov = compat_alloc_user_space(nr_segs * sizeof(struct iovec)); | ||
1329 | for (i = 0; i < nr_segs; i++) { | ||
1330 | struct compat_iovec v; | ||
1331 | if (get_user(v.iov_base, &iov32[i].iov_base) || | ||
1332 | get_user(v.iov_len, &iov32[i].iov_len) || | ||
1333 | put_user(compat_ptr(v.iov_base), &iov[i].iov_base) || | ||
1334 | put_user(v.iov_len, &iov[i].iov_len)) | ||
1335 | return -EFAULT; | ||
1336 | } | ||
1337 | return sys_vmsplice(fd, iov, nr_segs, flags); | ||
1338 | } | ||
1339 | |||
1320 | /* | 1340 | /* |
1321 | * Exactly like fs/open.c:sys_open(), except that it doesn't set the | 1341 | * Exactly like fs/open.c:sys_open(), except that it doesn't set the |
1322 | * O_LARGEFILE flag. | 1342 | * O_LARGEFILE flag. |