diff options
author | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2009-01-18 22:00:57 -0500 |
---|---|---|
committer | Lachlan McIlroy <lachlan@sgi.com> | 2009-01-18 22:00:57 -0500 |
commit | 6c5200ce3c528a8f7695ee62f33ad84d8f84d444 (patch) | |
tree | b240465c2dadbe0366a5b66d60c4776be1b7670d /fs/read_write.c | |
parent | 9d87c3192d96ef9ac1cec8321538e9b35e90b5aa (diff) | |
parent | f3b8436ad9a8ad36b3c9fa1fe030c7f38e5d3d0b (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'fs/read_write.c')
-rw-r--r-- | fs/read_write.c | 49 |
1 files changed, 33 insertions, 16 deletions
diff --git a/fs/read_write.c b/fs/read_write.c index 5cc6924eb158..400fe81c973e 100644 --- a/fs/read_write.c +++ b/fs/read_write.c | |||
@@ -147,7 +147,7 @@ loff_t vfs_llseek(struct file *file, loff_t offset, int origin) | |||
147 | } | 147 | } |
148 | EXPORT_SYMBOL(vfs_llseek); | 148 | EXPORT_SYMBOL(vfs_llseek); |
149 | 149 | ||
150 | asmlinkage off_t sys_lseek(unsigned int fd, off_t offset, unsigned int origin) | 150 | SYSCALL_DEFINE3(lseek, unsigned int, fd, off_t, offset, unsigned int, origin) |
151 | { | 151 | { |
152 | off_t retval; | 152 | off_t retval; |
153 | struct file * file; | 153 | struct file * file; |
@@ -171,9 +171,9 @@ bad: | |||
171 | } | 171 | } |
172 | 172 | ||
173 | #ifdef __ARCH_WANT_SYS_LLSEEK | 173 | #ifdef __ARCH_WANT_SYS_LLSEEK |
174 | asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high, | 174 | SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned long, offset_high, |
175 | unsigned long offset_low, loff_t __user * result, | 175 | unsigned long, offset_low, loff_t __user *, result, |
176 | unsigned int origin) | 176 | unsigned int, origin) |
177 | { | 177 | { |
178 | int retval; | 178 | int retval; |
179 | struct file * file; | 179 | struct file * file; |
@@ -369,7 +369,7 @@ static inline void file_pos_write(struct file *file, loff_t pos) | |||
369 | file->f_pos = pos; | 369 | file->f_pos = pos; |
370 | } | 370 | } |
371 | 371 | ||
372 | asmlinkage ssize_t sys_read(unsigned int fd, char __user * buf, size_t count) | 372 | SYSCALL_DEFINE3(read, unsigned int, fd, char __user *, buf, size_t, count) |
373 | { | 373 | { |
374 | struct file *file; | 374 | struct file *file; |
375 | ssize_t ret = -EBADF; | 375 | ssize_t ret = -EBADF; |
@@ -386,7 +386,8 @@ asmlinkage ssize_t sys_read(unsigned int fd, char __user * buf, size_t count) | |||
386 | return ret; | 386 | return ret; |
387 | } | 387 | } |
388 | 388 | ||
389 | asmlinkage ssize_t sys_write(unsigned int fd, const char __user * buf, size_t count) | 389 | SYSCALL_DEFINE3(write, unsigned int, fd, const char __user *, buf, |
390 | size_t, count) | ||
390 | { | 391 | { |
391 | struct file *file; | 392 | struct file *file; |
392 | ssize_t ret = -EBADF; | 393 | ssize_t ret = -EBADF; |
@@ -403,8 +404,8 @@ asmlinkage ssize_t sys_write(unsigned int fd, const char __user * buf, size_t co | |||
403 | return ret; | 404 | return ret; |
404 | } | 405 | } |
405 | 406 | ||
406 | asmlinkage ssize_t sys_pread64(unsigned int fd, char __user *buf, | 407 | SYSCALL_DEFINE(pread64)(unsigned int fd, char __user *buf, |
407 | size_t count, loff_t pos) | 408 | size_t count, loff_t pos) |
408 | { | 409 | { |
409 | struct file *file; | 410 | struct file *file; |
410 | ssize_t ret = -EBADF; | 411 | ssize_t ret = -EBADF; |
@@ -423,9 +424,17 @@ asmlinkage ssize_t sys_pread64(unsigned int fd, char __user *buf, | |||
423 | 424 | ||
424 | return ret; | 425 | return ret; |
425 | } | 426 | } |
427 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
428 | asmlinkage long SyS_pread64(long fd, long buf, long count, loff_t pos) | ||
429 | { | ||
430 | return SYSC_pread64((unsigned int) fd, (char __user *) buf, | ||
431 | (size_t) count, pos); | ||
432 | } | ||
433 | SYSCALL_ALIAS(sys_pread64, SyS_pread64); | ||
434 | #endif | ||
426 | 435 | ||
427 | asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char __user *buf, | 436 | SYSCALL_DEFINE(pwrite64)(unsigned int fd, const char __user *buf, |
428 | size_t count, loff_t pos) | 437 | size_t count, loff_t pos) |
429 | { | 438 | { |
430 | struct file *file; | 439 | struct file *file; |
431 | ssize_t ret = -EBADF; | 440 | ssize_t ret = -EBADF; |
@@ -444,6 +453,14 @@ asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char __user *buf, | |||
444 | 453 | ||
445 | return ret; | 454 | return ret; |
446 | } | 455 | } |
456 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
457 | asmlinkage long SyS_pwrite64(long fd, long buf, long count, loff_t pos) | ||
458 | { | ||
459 | return SYSC_pwrite64((unsigned int) fd, (const char __user *) buf, | ||
460 | (size_t) count, pos); | ||
461 | } | ||
462 | SYSCALL_ALIAS(sys_pwrite64, SyS_pwrite64); | ||
463 | #endif | ||
447 | 464 | ||
448 | /* | 465 | /* |
449 | * Reduce an iovec's length in-place. Return the resulting number of segments | 466 | * Reduce an iovec's length in-place. Return the resulting number of segments |
@@ -672,8 +689,8 @@ ssize_t vfs_writev(struct file *file, const struct iovec __user *vec, | |||
672 | 689 | ||
673 | EXPORT_SYMBOL(vfs_writev); | 690 | EXPORT_SYMBOL(vfs_writev); |
674 | 691 | ||
675 | asmlinkage ssize_t | 692 | SYSCALL_DEFINE3(readv, unsigned long, fd, const struct iovec __user *, vec, |
676 | sys_readv(unsigned long fd, const struct iovec __user *vec, unsigned long vlen) | 693 | unsigned long, vlen) |
677 | { | 694 | { |
678 | struct file *file; | 695 | struct file *file; |
679 | ssize_t ret = -EBADF; | 696 | ssize_t ret = -EBADF; |
@@ -693,8 +710,8 @@ sys_readv(unsigned long fd, const struct iovec __user *vec, unsigned long vlen) | |||
693 | return ret; | 710 | return ret; |
694 | } | 711 | } |
695 | 712 | ||
696 | asmlinkage ssize_t | 713 | SYSCALL_DEFINE3(writev, unsigned long, fd, const struct iovec __user *, vec, |
697 | sys_writev(unsigned long fd, const struct iovec __user *vec, unsigned long vlen) | 714 | unsigned long, vlen) |
698 | { | 715 | { |
699 | struct file *file; | 716 | struct file *file; |
700 | ssize_t ret = -EBADF; | 717 | ssize_t ret = -EBADF; |
@@ -812,7 +829,7 @@ out: | |||
812 | return retval; | 829 | return retval; |
813 | } | 830 | } |
814 | 831 | ||
815 | asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t __user *offset, size_t count) | 832 | SYSCALL_DEFINE4(sendfile, int, out_fd, int, in_fd, off_t __user *, offset, size_t, count) |
816 | { | 833 | { |
817 | loff_t pos; | 834 | loff_t pos; |
818 | off_t off; | 835 | off_t off; |
@@ -831,7 +848,7 @@ asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t __user *offset, siz | |||
831 | return do_sendfile(out_fd, in_fd, NULL, count, 0); | 848 | return do_sendfile(out_fd, in_fd, NULL, count, 0); |
832 | } | 849 | } |
833 | 850 | ||
834 | asmlinkage ssize_t sys_sendfile64(int out_fd, int in_fd, loff_t __user *offset, size_t count) | 851 | SYSCALL_DEFINE4(sendfile64, int, out_fd, int, in_fd, loff_t __user *, offset, size_t, count) |
835 | { | 852 | { |
836 | loff_t pos; | 853 | loff_t pos; |
837 | ssize_t ret; | 854 | ssize_t ret; |