diff --git a/[refs] b/[refs] index 1249d9d1fe8d..b0619a159cac 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 98310e581e098514867573031b2bfa4ba89c0d93 +refs/heads/master: dac1213842f5caf081804a11d87d2a39a21d6f55 diff --git a/trunk/fs/compat.c b/trunk/fs/compat.c index 55efdfebdf5a..e99048c21c56 100644 --- a/trunk/fs/compat.c +++ b/trunk/fs/compat.c @@ -1195,16 +1195,12 @@ static ssize_t compat_do_readv_writev(int type, struct file *file, return ret; } -asmlinkage ssize_t -compat_sys_readv(unsigned long fd, const struct compat_iovec __user *vec, unsigned long vlen) +static size_t compat_readv(struct file *file, + const struct compat_iovec __user *vec, + unsigned long vlen, loff_t *pos) { - struct file *file; ssize_t ret = -EBADF; - file = fget(fd); - if (!file) - return -EBADF; - if (!(file->f_mode & FMODE_READ)) goto out; @@ -1212,12 +1208,26 @@ compat_sys_readv(unsigned long fd, const struct compat_iovec __user *vec, unsign if (!file->f_op || (!file->f_op->aio_read && !file->f_op->read)) goto out; - ret = compat_do_readv_writev(READ, file, vec, vlen, &file->f_pos); + ret = compat_do_readv_writev(READ, file, vec, vlen, pos); out: if (ret > 0) add_rchar(current, ret); inc_syscr(current); + return ret; +} + +asmlinkage ssize_t +compat_sys_readv(unsigned long fd, const struct compat_iovec __user *vec, + unsigned long vlen) +{ + struct file *file; + ssize_t ret; + + file = fget(fd); + if (!file) + return -EBADF; + ret = compat_readv(file, vec, vlen, &file->f_pos); fput(file); return ret; }