Commit 5ff53a14 authored by Linus Torvalds's avatar Linus Torvalds Committed by Linus Torvalds

Rename "sys_pread/pwrite" to "sys_pread64/pwrite64" to match the

actual implementation and avoid confusion.
parent 12ebbff8
......@@ -1081,8 +1081,8 @@ sys_call_table:
.quad sys_pciconfig_write
.quad sys_query_module
.quad sys_prctl
.quad sys_pread
.quad sys_pwrite /* 350 */
.quad sys_pread64
.quad sys_pwrite64 /* 350 */
.quad sys_rt_sigreturn
.quad sys_rt_sigaction
.quad sys_rt_sigprocmask
......
......@@ -194,8 +194,8 @@ __syscall_start:
.long sys_rt_sigtimedwait
.long sys_rt_sigqueueinfo
.long sys_rt_sigsuspend_wrapper
/* 180 */ .long sys_pread
.long sys_pwrite
/* 180 */ .long sys_pread64
.long sys_pwrite64
.long sys_chown16
.long sys_getcwd
.long sys_capget
......
......@@ -689,8 +689,8 @@ ENTRY(sys_call_table)
.long sys_rt_sigtimedwait
.long sys_rt_sigqueueinfo
.long sys_rt_sigsuspend
.long sys_pread /* 180 */
.long sys_pwrite
.long sys_pread64 /* 180 */
.long sys_pwrite64
.long sys_chown16
.long sys_getcwd
.long sys_capget
......
......@@ -3648,15 +3648,15 @@ sys32_sched_rr_get_interval (pid_t pid, struct timespec32 *interval)
asmlinkage long
sys32_pread (unsigned int fd, void *buf, unsigned int count, u32 pos_lo, u32 pos_hi)
{
extern asmlinkage long sys_pread (unsigned int, char *, size_t, loff_t);
return sys_pread(fd, buf, count, ((unsigned long) pos_hi << 32) | pos_lo);
extern asmlinkage long sys_pread64 (unsigned int, char *, size_t, loff_t);
return sys_pread64(fd, buf, count, ((unsigned long) pos_hi << 32) | pos_lo);
}
asmlinkage long
sys32_pwrite (unsigned int fd, void *buf, unsigned int count, u32 pos_lo, u32 pos_hi)
{
extern asmlinkage long sys_pwrite (unsigned int, const char *, size_t, loff_t);
return sys_pwrite(fd, buf, count, ((unsigned long) pos_hi << 32) | pos_lo);
extern asmlinkage long sys_pwrite64 (unsigned int, const char *, size_t, loff_t);
return sys_pwrite64(fd, buf, count, ((unsigned long) pos_hi << 32) | pos_lo);
}
asmlinkage long
......
......@@ -1134,8 +1134,8 @@ sys_call_table:
data8 sys_flock // 1145
data8 sys_readv
data8 sys_writev
data8 sys_pread
data8 sys_pwrite
data8 sys_pread64
data8 sys_pwrite64
data8 sys_sysctl // 1150
data8 sys_mmap
data8 sys_munmap
......
......@@ -608,8 +608,8 @@ sys_call_table:
.long sys_rt_sigtimedwait
.long sys_rt_sigqueueinfo
.long sys_rt_sigsuspend
.long sys_pread /* 180 */
.long sys_pwrite
.long sys_pread64 /* 180 */
.long sys_pwrite64
.long sys_lchown16;
.long sys_getcwd
.long sys_capget
......
......@@ -333,8 +333,8 @@ sys_call_table:
PTR sys_rt_sigtimedwait
PTR sys_rt_sigqueueinfo
PTR sys_rt_sigsuspend
PTR sys_pread /* 5200 */
PTR sys_pwrite
PTR sys_pread64 /* 5200 */
PTR sys_pwrite64
PTR sys_chown
PTR sys_getcwd
PTR sys_capget
......
......@@ -1251,8 +1251,8 @@ _GLOBAL(sys_call_table)
.long sys_rt_sigtimedwait
.long sys_rt_sigqueueinfo
.long ppc_rt_sigsuspend
.long sys_pread
.long sys_pwrite /* 180 */
.long sys_pread64
.long sys_pwrite64 /* 180 */
.long sys_chown
.long sys_getcwd
.long sys_capget
......
......@@ -916,8 +916,8 @@ _GLOBAL(sys_call_table)
.llong .sys_rt_sigtimedwait
.llong .sys_rt_sigqueueinfo
.llong .sys_rt_sigsuspend
.llong .sys_pread
.llong .sys_pwrite /* 180 */
.llong .sys_pread64
.llong .sys_pwrite64 /* 180 */
.llong .sys_chown
.llong .sys_getcwd
.llong .sys_capget
......
......@@ -520,8 +520,8 @@ sys_call_table:
.long sys_rt_sigtimedwait
.long sys_rt_sigqueueinfo
.long sys_rt_sigsuspend_glue
.long sys_pread /* 180 */
.long sys_pwrite
.long sys_pread64 /* 180 */
.long sys_pwrite64
.long sys_chown16
.long sys_getcwd
.long sys_capget
......
......@@ -3980,10 +3980,10 @@ asmlinkage int sys32_prctl(int option, u32 arg2, u32 arg3, u32 arg4, u32 arg5)
}
extern asmlinkage ssize_t sys_pread(unsigned int fd, char * buf,
extern asmlinkage ssize_t sys_pread64(unsigned int fd, char * buf,
size_t count, loff_t pos);
extern asmlinkage ssize_t sys_pwrite(unsigned int fd, const char * buf,
extern asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char * buf,
size_t count, loff_t pos);
typedef __kernel_ssize_t32 ssize_t32;
......@@ -3991,13 +3991,13 @@ typedef __kernel_ssize_t32 ssize_t32;
asmlinkage ssize_t32 sys32_pread(unsigned int fd, char *ubuf,
__kernel_size_t32 count, u32 poshi, u32 poslo)
{
return sys_pread(fd, ubuf, count, ((loff_t)AA(poshi) << 32) | AA(poslo));
return sys_pread64(fd, ubuf, count, ((loff_t)AA(poshi) << 32) | AA(poslo));
}
asmlinkage ssize_t32 sys32_pwrite(unsigned int fd, char *ubuf,
__kernel_size_t32 count, u32 poshi, u32 poslo)
{
return sys_pwrite(fd, ubuf, count, ((loff_t)AA(poshi) << 32) | AA(poslo));
return sys_pwrite64(fd, ubuf, count, ((loff_t)AA(poshi) << 32) | AA(poslo));
}
extern asmlinkage ssize_t sys_readahead(int fd, loff_t offset, size_t count);
......
......@@ -31,7 +31,7 @@ sys_call_table:
/*50*/ .long sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, sys_ioctl
/*55*/ .long sys_reboot, sys_mmap2, sys_symlink, sys_readlink, sys_execve
/*60*/ .long sys_umask, sys_chroot, sys_newfstat, sys_fstat64, sys_getpagesize
/*65*/ .long sys_msync, sys_vfork, sys_pread, sys_pwrite, sys_geteuid
/*65*/ .long sys_msync, sys_vfork, sys_pread64, sys_pwrite64, sys_geteuid
/*70*/ .long sys_getegid, sys_mmap, sys_setreuid, sys_munmap, sys_mprotect
/*75*/ .long sys_madvise, sys_vhangup, sys_truncate64, sys_mincore, sys_getgroups16
/*80*/ .long sys_setgroups16, sys_getpgrp, sys_setgroups, sys_setitimer, sys_ftruncate64
......
......@@ -3878,10 +3878,10 @@ asmlinkage int sys32_prctl(int option, u32 arg2, u32 arg3, u32 arg4, u32 arg5)
}
extern asmlinkage ssize_t sys_pread(unsigned int fd, char * buf,
extern asmlinkage ssize_t sys_pread64(unsigned int fd, char * buf,
size_t count, loff_t pos);
extern asmlinkage ssize_t sys_pwrite(unsigned int fd, const char * buf,
extern asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char * buf,
size_t count, loff_t pos);
typedef __kernel_ssize_t32 ssize_t32;
......@@ -3889,13 +3889,13 @@ typedef __kernel_ssize_t32 ssize_t32;
asmlinkage ssize_t32 sys32_pread(unsigned int fd, char *ubuf,
__kernel_size_t32 count, u32 poshi, u32 poslo)
{
return sys_pread(fd, ubuf, count, ((loff_t)AA(poshi) << 32) | AA(poslo));
return sys_pread64(fd, ubuf, count, ((loff_t)AA(poshi) << 32) | AA(poslo));
}
asmlinkage ssize_t32 sys32_pwrite(unsigned int fd, char *ubuf,
__kernel_size_t32 count, u32 poshi, u32 poslo)
{
return sys_pwrite(fd, ubuf, count, ((loff_t)AA(poshi) << 32) | AA(poslo));
return sys_pwrite64(fd, ubuf, count, ((loff_t)AA(poshi) << 32) | AA(poslo));
}
extern asmlinkage ssize_t sys_readahead(int fd, loff_t offset, size_t count);
......
......@@ -32,7 +32,7 @@ sys_call_table32:
/*50*/ .word sys32_getegid16, sys_acct, sys_nis_syscall, sys_getgid, sys32_ioctl
.word sys_reboot, sys32_mmap2, sys_symlink, sys_readlink, sys32_execve
/*60*/ .word sys_umask, sys_chroot, sys32_newfstat, sys_fstat64, sys_getpagesize
.word sys_msync, sys_vfork, sys32_pread, sys32_pwrite, sys_geteuid
.word sys_msync, sys_vfork, sys32_pread64, sys32_pwrite64, sys_geteuid
/*70*/ .word sys_getegid, sys32_mmap, sys_setreuid, sys_munmap, sys_mprotect
.word sys_madvise, sys_vhangup, sys32_truncate64, sys_mincore, sys32_getgroups16
/*80*/ .word sys32_setgroups16, sys_getpgrp, sys_setgroups, sys32_setitimer, sys32_ftruncate64
......
......@@ -1948,10 +1948,10 @@ sys32_newuname(struct new_utsname * name)
return ret;
}
extern asmlinkage ssize_t sys_pread(unsigned int fd, char * buf,
extern asmlinkage ssize_t sys_pread64(unsigned int fd, char * buf,
size_t count, loff_t pos);
extern asmlinkage ssize_t sys_pwrite(unsigned int fd, const char * buf,
extern asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char * buf,
size_t count, loff_t pos);
typedef __kernel_ssize_t32 ssize_t32;
......@@ -1961,7 +1961,7 @@ asmlinkage ssize_t32
sys32_pread(unsigned int fd, char *ubuf, __kernel_size_t32 count,
u32 poslo, u32 poshi)
{
return sys_pread(fd, ubuf, count,
return sys_pread64(fd, ubuf, count,
((loff_t)AA(poshi) << 32) | AA(poslo));
}
......@@ -1969,7 +1969,7 @@ asmlinkage ssize_t32
sys32_pwrite(unsigned int fd, char *ubuf, __kernel_size_t32 count,
u32 poslo, u32 poshi)
{
return sys_pwrite(fd, ubuf, count,
return sys_pwrite64(fd, ubuf, count,
((loff_t)AA(poshi) << 32) | AA(poslo));
}
......
......@@ -185,8 +185,6 @@ ssize_t vfs_read(struct file *file, char *buf, size_t count, loff_t *pos)
return -EBADF;
if (!file->f_op || !file->f_op->read)
return -EINVAL;
if (pos < 0)
return -EINVAL;
ret = locks_verify_area(FLOCK_VERIFY_READ, inode, file, *pos, count);
if (!ret) {
......@@ -210,8 +208,6 @@ ssize_t vfs_write(struct file *file, const char *buf, size_t count, loff_t *pos)
return -EBADF;
if (!file->f_op || !file->f_op->write)
return -EINVAL;
if (pos < 0)
return -EINVAL;
ret = locks_verify_area(FLOCK_VERIFY_WRITE, inode, file, *pos, count);
if (!ret) {
......@@ -254,12 +250,15 @@ asmlinkage ssize_t sys_write(unsigned int fd, const char * buf, size_t count)
return ret;
}
asmlinkage ssize_t sys_pread(unsigned int fd, char *buf,
asmlinkage ssize_t sys_pread64(unsigned int fd, char *buf,
size_t count, loff_t pos)
{
struct file *file;
ssize_t ret = -EBADF;
if (pos < 0)
return -EINVAL;
file = fget(fd);
if (file) {
ret = vfs_read(file, buf, count, &pos);
......@@ -269,12 +268,15 @@ asmlinkage ssize_t sys_pread(unsigned int fd, char *buf,
return ret;
}
asmlinkage ssize_t sys_pwrite(unsigned int fd, const char *buf,
asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char *buf,
size_t count, loff_t pos)
{
struct file *file;
ssize_t ret = -EBADF;
if (pos < 0)
return -EINVAL;
file = fget(fd);
if (file) {
ret = vfs_write(file, buf, count, &pos);
......
......@@ -286,8 +286,8 @@
#define __NR_pciconfig_write 346
#define __NR_query_module 347
#define __NR_prctl 348
#define __NR_pread 349
#define __NR_pwrite 350
#define __NR_pread64 349
#define __NR_pwrite64 350
#define __NR_rt_sigreturn 351
#define __NR_rt_sigaction 352
#define __NR_rt_sigprocmask 353
......
......@@ -200,8 +200,8 @@
#define __NR_rt_sigtimedwait (__NR_SYSCALL_BASE+177)
#define __NR_rt_sigqueueinfo (__NR_SYSCALL_BASE+178)
#define __NR_rt_sigsuspend (__NR_SYSCALL_BASE+179)
#define __NR_pread (__NR_SYSCALL_BASE+180)
#define __NR_pwrite (__NR_SYSCALL_BASE+181)
#define __NR_pread64 (__NR_SYSCALL_BASE+180)
#define __NR_pwrite64 (__NR_SYSCALL_BASE+181)
#define __NR_chown (__NR_SYSCALL_BASE+182)
#define __NR_getcwd (__NR_SYSCALL_BASE+183)
#define __NR_capget (__NR_SYSCALL_BASE+184)
......
......@@ -185,8 +185,8 @@
#define __NR_rt_sigtimedwait 177
#define __NR_rt_sigqueueinfo 178
#define __NR_rt_sigsuspend 179
#define __NR_pread 180
#define __NR_pwrite 181
#define __NR_pread64 180
#define __NR_pwrite64 181
#define __NR_chown 182
#define __NR_getcwd 183
#define __NR_capget 184
......
......@@ -184,8 +184,8 @@
#define __NR_rt_sigtimedwait 177
#define __NR_rt_sigqueueinfo 178
#define __NR_rt_sigsuspend 179
#define __NR_pread 180
#define __NR_pwrite 181
#define __NR_pread64 180
#define __NR_pwrite64 181
#define __NR_chown 182
#define __NR_getcwd 183
#define __NR_capget 184
......
......@@ -137,8 +137,8 @@
#define __NR_flock 1145
#define __NR_readv 1146
#define __NR_writev 1147
#define __NR_pread 1148
#define __NR_pwrite 1149
#define __NR_pread64 1148
#define __NR_pwrite64 1149
#define __NR__sysctl 1150
#define __NR_mmap 1151
#define __NR_munmap 1152
......
......@@ -184,8 +184,8 @@
#define __NR_rt_sigtimedwait 177
#define __NR_rt_sigqueueinfo 178
#define __NR_rt_sigsuspend 179
#define __NR_pread 180
#define __NR_pwrite 181
#define __NR_pread64 180
#define __NR_pwrite64 181
#define __NR_lchown 182
#define __NR_getcwd 183
#define __NR_capget 184
......
......@@ -212,8 +212,8 @@
#define __NR_rt_sigtimedwait (__NR_Linux + 197)
#define __NR_rt_sigqueueinfo (__NR_Linux + 198)
#define __NR_rt_sigsuspend (__NR_Linux + 199)
#define __NR_pread (__NR_Linux + 200)
#define __NR_pwrite (__NR_Linux + 201)
#define __NR_pread64 (__NR_Linux + 200)
#define __NR_pwrite64 (__NR_Linux + 201)
#define __NR_chown (__NR_Linux + 202)
#define __NR_getcwd (__NR_Linux + 203)
#define __NR_capget (__NR_Linux + 204)
......
......@@ -447,8 +447,8 @@
#define __NR_rt_sigtimedwait (__NR_Linux + 197)
#define __NR_rt_sigqueueinfo (__NR_Linux + 198)
#define __NR_rt_sigsuspend (__NR_Linux + 199)
#define __NR_pread (__NR_Linux + 200)
#define __NR_pwrite (__NR_Linux + 201)
#define __NR_pread64 (__NR_Linux + 200)
#define __NR_pwrite64 (__NR_Linux + 201)
#define __NR_chown (__NR_Linux + 202)
#define __NR_getcwd (__NR_Linux + 203)
#define __NR_capget (__NR_Linux + 204)
......
......@@ -598,8 +598,8 @@
#define __NR_getitimer (__NR_Linux + 105)
#define __NR_capget (__NR_Linux + 106)
#define __NR_capset (__NR_Linux + 107)
#define __NR_pread (__NR_Linux + 108)
#define __NR_pwrite (__NR_Linux + 109)
#define __NR_pread64 (__NR_Linux + 108)
#define __NR_pwrite64 (__NR_Linux + 109)
#define __NR_getcwd (__NR_Linux + 110)
#define __NR_vhangup (__NR_Linux + 111)
#define __NR_idle (__NR_Linux + 112)
......
......@@ -186,8 +186,8 @@
#define __NR_rt_sigtimedwait 176
#define __NR_rt_sigqueueinfo 177
#define __NR_rt_sigsuspend 178
#define __NR_pread 179
#define __NR_pwrite 180
#define __NR_pread64 179
#define __NR_pwrite64 180
#define __NR_chown 181
#define __NR_getcwd 182
#define __NR_capget 183
......
......@@ -188,8 +188,8 @@
#define __NR_rt_sigtimedwait 176
#define __NR_rt_sigqueueinfo 177
#define __NR_rt_sigsuspend 178
#define __NR_pread 179
#define __NR_pwrite 180
#define __NR_pread64 179
#define __NR_pwrite64 180
#define __NR_chown 181
#define __NR_getcwd 182
#define __NR_capget 183
......
......@@ -170,8 +170,8 @@
#define __NR_rt_sigtimedwait 177
#define __NR_rt_sigqueueinfo 178
#define __NR_rt_sigsuspend 179
#define __NR_pread 180
#define __NR_pwrite 181
#define __NR_pread64 180
#define __NR_pwrite64 181
#define __NR_chown 182
#define __NR_getcwd 183
#define __NR_capget 184
......
......@@ -147,8 +147,8 @@
#define __NR_rt_sigtimedwait 177
#define __NR_rt_sigqueueinfo 178
#define __NR_rt_sigsuspend 179
#define __NR_pread 180
#define __NR_pwrite 181
#define __NR_pread64 180
#define __NR_pwrite64 181
#define __NR_getcwd 183
#define __NR_capget 184
#define __NR_capset 185
......
......@@ -189,8 +189,8 @@
#define __NR_rt_sigtimedwait 177
#define __NR_rt_sigqueueinfo 178
#define __NR_rt_sigsuspend 179
#define __NR_pread 180
#define __NR_pwrite 181
#define __NR_pread64 180
#define __NR_pwrite64 181
#define __NR_chown 182
#define __NR_getcwd 183
#define __NR_capget 184
......
......@@ -82,8 +82,8 @@
#define __NR_getpagesize 64 /* Common */
#define __NR_msync 65 /* Common in newer 1.3.x revs... */
#define __NR_vfork 66 /* Common */
#define __NR_pread 67 /* Linux Specific */
#define __NR_pwrite 68 /* Linux Specific */
#define __NR_pread64 67 /* Linux Specific */
#define __NR_pwrite64 68 /* Linux Specific */
#define __NR_geteuid32 69 /* Linux sparc32, sbrk under SunOS */
#define __NR_getegid32 70 /* Linux sparc32, sstk under SunOS */
#define __NR_mmap 71 /* Common */
......
......@@ -82,8 +82,8 @@
#define __NR_getpagesize 64 /* Common */
#define __NR_msync 65 /* Common in newer 1.3.x revs... */
#define __NR_vfork 66 /* Common */
#define __NR_pread 67 /* Linux Specific */
#define __NR_pwrite 68 /* Linux Specific */
#define __NR_pread64 67 /* Linux Specific */
#define __NR_pwrite64 68 /* Linux Specific */
/* #define __NR_geteuid32 69 Linux sparc32, sbrk under SunOS */
/* #define __NR_getegid32 70 Linux sparc32, sstk under SunOS */
#define __NR_mmap 71 /* Common */
......
......@@ -48,10 +48,10 @@ __SYSCALL(__NR_rt_sigreturn, stub_rt_sigreturn)
#define __NR_ioctl 16
__SYSCALL(__NR_ioctl, sys_ioctl)
#define __NR_pread 17
__SYSCALL(__NR_pread, sys_pread)
#define __NR_pwrite 18
__SYSCALL(__NR_pwrite, sys_pwrite)
#define __NR_pread64 17
__SYSCALL(__NR_pread64, sys_pread64)
#define __NR_pwrite64 18
__SYSCALL(__NR_pwrite64, sys_pwrite64)
#define __NR_readv 19
__SYSCALL(__NR_readv, sys_readv)
#define __NR_writev 20
......
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