diff options
author | H. J. Lu <hjl.tools@gmail.com> | 2012-02-14 16:30:41 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2012-02-20 15:48:48 -0500 |
commit | 4ee5c0d05ce9b4e48e586a1ee168f166d191ddda (patch) | |
tree | 72f0c221b933bf717cb0074c24c62811a1d44360 /fs/compat.c | |
parent | ff88943a1471440cc6be7a11a942a5a8232bee61 (diff) |
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: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'fs/compat.c')
-rw-r--r-- | fs/compat.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/fs/compat.c b/fs/compat.c index fa9d721ecfee..83d751c78885 100644 --- a/fs/compat.c +++ b/fs/compat.c | |||
@@ -1177,10 +1177,9 @@ compat_sys_readv(unsigned long fd, const struct compat_iovec __user *vec, | |||
1177 | } | 1177 | } |
1178 | 1178 | ||
1179 | asmlinkage ssize_t | 1179 | asmlinkage ssize_t |
1180 | compat_sys_preadv(unsigned long fd, const struct compat_iovec __user *vec, | 1180 | compat_sys_preadv64(unsigned long fd, const struct compat_iovec __user *vec, |
1181 | unsigned long vlen, u32 pos_low, u32 pos_high) | 1181 | unsigned long vlen, loff_t pos) |
1182 | { | 1182 | { |
1183 | loff_t pos = ((loff_t)pos_high << 32) | pos_low; | ||
1184 | struct file *file; | 1183 | struct file *file; |
1185 | int fput_needed; | 1184 | int fput_needed; |
1186 | ssize_t ret; | 1185 | ssize_t ret; |
@@ -1197,6 +1196,14 @@ compat_sys_preadv(unsigned long fd, const struct compat_iovec __user *vec, | |||
1197 | return ret; | 1196 | return ret; |
1198 | } | 1197 | } |
1199 | 1198 | ||
1199 | asmlinkage ssize_t | ||
1200 | compat_sys_preadv(unsigned long fd, const struct compat_iovec __user *vec, | ||
1201 | unsigned long vlen, u32 pos_low, u32 pos_high) | ||
1202 | { | ||
1203 | loff_t pos = ((loff_t)pos_high << 32) | pos_low; | ||
1204 | return compat_sys_preadv64(fd, vec, vlen, pos); | ||
1205 | } | ||
1206 | |||
1200 | static size_t compat_writev(struct file *file, | 1207 | static size_t compat_writev(struct file *file, |
1201 | const struct compat_iovec __user *vec, | 1208 | const struct compat_iovec __user *vec, |
1202 | unsigned long vlen, loff_t *pos) | 1209 | unsigned long vlen, loff_t *pos) |
@@ -1236,10 +1243,9 @@ compat_sys_writev(unsigned long fd, const struct compat_iovec __user *vec, | |||
1236 | } | 1243 | } |
1237 | 1244 | ||
1238 | asmlinkage ssize_t | 1245 | asmlinkage ssize_t |
1239 | compat_sys_pwritev(unsigned long fd, const struct compat_iovec __user *vec, | 1246 | compat_sys_pwritev64(unsigned long fd, const struct compat_iovec __user *vec, |
1240 | unsigned long vlen, u32 pos_low, u32 pos_high) | 1247 | unsigned long vlen, loff_t pos) |
1241 | { | 1248 | { |
1242 | loff_t pos = ((loff_t)pos_high << 32) | pos_low; | ||
1243 | struct file *file; | 1249 | struct file *file; |
1244 | int fput_needed; | 1250 | int fput_needed; |
1245 | ssize_t ret; | 1251 | ssize_t ret; |
@@ -1256,6 +1262,14 @@ compat_sys_pwritev(unsigned long fd, const struct compat_iovec __user *vec, | |||
1256 | return ret; | 1262 | return ret; |
1257 | } | 1263 | } |
1258 | 1264 | ||
1265 | asmlinkage ssize_t | ||
1266 | compat_sys_pwritev(unsigned long fd, const struct compat_iovec __user *vec, | ||
1267 | unsigned long vlen, u32 pos_low, u32 pos_high) | ||
1268 | { | ||
1269 | loff_t pos = ((loff_t)pos_high << 32) | pos_low; | ||
1270 | return compat_sys_pwritev64(fd, vec, vlen, pos); | ||
1271 | } | ||
1272 | |||
1259 | asmlinkage long | 1273 | asmlinkage long |
1260 | compat_sys_vmsplice(int fd, const struct compat_iovec __user *iov32, | 1274 | compat_sys_vmsplice(int fd, const struct compat_iovec __user *iov32, |
1261 | unsigned int nr_segs, unsigned int flags) | 1275 | unsigned int nr_segs, unsigned int flags) |