aboutsummaryrefslogtreecommitdiffstats
path: root/fs/compat.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2006-05-01 15:15:48 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-05-01 21:17:43 -0400
commitd2610202290b4924b71747314a0f88f28807702e (patch)
treebdfde16e24caa597f66504d555b06ee2e480ef54 /fs/compat.c
parent5e7dd2ab6b9bdfa60e19b8739e6b2a204fd4f477 (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>
Diffstat (limited to 'fs/compat.c')
-rw-r--r--fs/compat.c20
1 files changed, 20 insertions, 0 deletions
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
1320asmlinkage long
1321compat_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.