]> err.no Git - linux-2.6/blobdiff - arch/mips/kernel/linux32.c
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-mmc
[linux-2.6] / arch / mips / kernel / linux32.c
index 3f40c37a9ee670252a56abf6066ad3b0cbfaec0d..450ac592da576c8314a1cec7d0851d891e4cc1d7 100644 (file)
@@ -5,7 +5,6 @@
  * Written by Ulf Carlsson (ulfc@engr.sgi.com)
  * sys32_execve from ia64/ia32 code, Feb 2000, Kanoj Sarcar (kanoj@sgi.com)
  */
-#include <linux/config.h>
 #include <linux/compiler.h>
 #include <linux/mm.h>
 #include <linux/errno.h>
@@ -356,73 +355,13 @@ asmlinkage int sys32_llseek(unsigned int fd, unsigned int offset_high,
 asmlinkage ssize_t sys32_pread(unsigned int fd, char __user * buf,
                               size_t count, u32 unused, u64 a4, u64 a5)
 {
-       ssize_t ret;
-       struct file * file;
-       ssize_t (*read)(struct file *, char __user *, size_t, loff_t *);
-       loff_t pos;
-
-       ret = -EBADF;
-       file = fget(fd);
-       if (!file)
-               goto bad_file;
-       if (!(file->f_mode & FMODE_READ))
-               goto out;
-       pos = merge_64(a4, a5);
-       ret = rw_verify_area(READ, file, &pos, count);
-       if (ret < 0)
-               goto out;
-       ret = -EINVAL;
-       if (!file->f_op || !(read = file->f_op->read))
-               goto out;
-       if (pos < 0)
-               goto out;
-       ret = -ESPIPE;
-       if (!(file->f_mode & FMODE_PREAD))
-               goto out;
-       ret = read(file, buf, count, &pos);
-       if (ret > 0)
-               dnotify_parent(file->f_dentry, DN_ACCESS);
-out:
-       fput(file);
-bad_file:
-       return ret;
+       return sys_pread64(fd, buf, count, merge_64(a4, a5));
 }
 
 asmlinkage ssize_t sys32_pwrite(unsigned int fd, const char __user * buf,
                                size_t count, u32 unused, u64 a4, u64 a5)
 {
-       ssize_t ret;
-       struct file * file;
-       ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *);
-       loff_t pos;
-
-       ret = -EBADF;
-       file = fget(fd);
-       if (!file)
-               goto bad_file;
-       if (!(file->f_mode & FMODE_WRITE))
-               goto out;
-       pos = merge_64(a4, a5);
-       ret = rw_verify_area(WRITE, file, &pos, count);
-       if (ret < 0)
-               goto out;
-       ret = -EINVAL;
-       if (!file->f_op || !(write = file->f_op->write))
-               goto out;
-       if (pos < 0)
-               goto out;
-
-       ret = -ESPIPE;
-       if (!(file->f_mode & FMODE_PWRITE))
-               goto out;
-
-       ret = write(file, buf, count, &pos);
-       if (ret > 0)
-               dnotify_parent(file->f_dentry, DN_MODIFY);
-out:
-       fput(file);
-bad_file:
-       return ret;
+       return sys_pwrite64(fd, buf, count, merge_64(a4, a5));
 }
 
 asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid,
@@ -1182,6 +1121,16 @@ asmlinkage ssize_t sys32_readahead(int fd, u32 pad0, u64 a2, u64 a3,
        return sys_readahead(fd, merge_64(a2, a3), count);
 }
 
+asmlinkage long sys32_sync_file_range(int fd, int __pad,
+       unsigned long a2, unsigned long a3,
+       unsigned long a4, unsigned long a5,
+       int flags)
+{
+       return sys_sync_file_range(fd,
+                       merge_64(a2, a3), merge_64(a4, a5),
+                       flags);
+}
+
 /* Argument list sizes for sys_socketcall */
 #define AL(x) ((x) * sizeof(unsigned int))
 static unsigned char socketcall_nargs[18]={AL(0),AL(3),AL(3),AL(3),AL(2),AL(3),