Commit 4ee5c0d0 authored by H. J. Lu's avatar H. J. Lu Committed by H. Peter Anvin

compat: Create compat_sys_p{read,write}v64

For 32-bit ABIs which have real 64-bit registers, we don't want to
break the position argument into two.  However, we still need compat
support to deal with 32-bit pointers, so we can't just use
sys_p{read,write} directly.
Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
parent ff88943a
...@@ -1177,10 +1177,9 @@ compat_sys_readv(unsigned long fd, const struct compat_iovec __user *vec, ...@@ -1177,10 +1177,9 @@ compat_sys_readv(unsigned long fd, const struct compat_iovec __user *vec,
} }
asmlinkage ssize_t asmlinkage ssize_t
compat_sys_preadv(unsigned long fd, const struct compat_iovec __user *vec, compat_sys_preadv64(unsigned long fd, const struct compat_iovec __user *vec,
unsigned long vlen, u32 pos_low, u32 pos_high) unsigned long vlen, loff_t pos)
{ {
loff_t pos = ((loff_t)pos_high << 32) | pos_low;
struct file *file; struct file *file;
int fput_needed; int fput_needed;
ssize_t ret; ssize_t ret;
...@@ -1197,6 +1196,14 @@ compat_sys_preadv(unsigned long fd, const struct compat_iovec __user *vec, ...@@ -1197,6 +1196,14 @@ compat_sys_preadv(unsigned long fd, const struct compat_iovec __user *vec,
return ret; return ret;
} }
asmlinkage ssize_t
compat_sys_preadv(unsigned long fd, const struct compat_iovec __user *vec,
unsigned long vlen, u32 pos_low, u32 pos_high)
{
loff_t pos = ((loff_t)pos_high << 32) | pos_low;
return compat_sys_preadv64(fd, vec, vlen, pos);
}
static size_t compat_writev(struct file *file, static size_t compat_writev(struct file *file,
const struct compat_iovec __user *vec, const struct compat_iovec __user *vec,
unsigned long vlen, loff_t *pos) unsigned long vlen, loff_t *pos)
...@@ -1236,10 +1243,9 @@ compat_sys_writev(unsigned long fd, const struct compat_iovec __user *vec, ...@@ -1236,10 +1243,9 @@ compat_sys_writev(unsigned long fd, const struct compat_iovec __user *vec,
} }
asmlinkage ssize_t asmlinkage ssize_t
compat_sys_pwritev(unsigned long fd, const struct compat_iovec __user *vec, compat_sys_pwritev64(unsigned long fd, const struct compat_iovec __user *vec,
unsigned long vlen, u32 pos_low, u32 pos_high) unsigned long vlen, loff_t pos)
{ {
loff_t pos = ((loff_t)pos_high << 32) | pos_low;
struct file *file; struct file *file;
int fput_needed; int fput_needed;
ssize_t ret; ssize_t ret;
...@@ -1256,6 +1262,14 @@ compat_sys_pwritev(unsigned long fd, const struct compat_iovec __user *vec, ...@@ -1256,6 +1262,14 @@ compat_sys_pwritev(unsigned long fd, const struct compat_iovec __user *vec,
return ret; return ret;
} }
asmlinkage ssize_t
compat_sys_pwritev(unsigned long fd, const struct compat_iovec __user *vec,
unsigned long vlen, u32 pos_low, u32 pos_high)
{
loff_t pos = ((loff_t)pos_high << 32) | pos_low;
return compat_sys_pwritev64(fd, vec, vlen, pos);
}
asmlinkage long asmlinkage long
compat_sys_vmsplice(int fd, const struct compat_iovec __user *iov32, compat_sys_vmsplice(int fd, const struct compat_iovec __user *iov32,
unsigned int nr_segs, unsigned int flags) unsigned int nr_segs, unsigned int flags)
......
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