Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: <linux-api@vger.kernel.org>
Cc: <linux-arch@vger.kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
unsigned long vlen)
{
struct file *file;
unsigned long vlen)
{
struct file *file;
+ file = fget_light(fd, &fput_needed);
if (!file)
return -EBADF;
ret = compat_readv(file, vec, vlen, &file->f_pos);
if (!file)
return -EBADF;
ret = compat_readv(file, vec, vlen, &file->f_pos);
+ fput_light(file, fput_needed);
{
loff_t pos = ((loff_t)pos_high << 32) | pos_low;
struct file *file;
{
loff_t pos = ((loff_t)pos_high << 32) | pos_low;
struct file *file;
ssize_t ret;
if (pos < 0)
return -EINVAL;
ssize_t ret;
if (pos < 0)
return -EINVAL;
+ file = fget_light(fd, &fput_needed);
if (!file)
return -EBADF;
ret = compat_readv(file, vec, vlen, &pos);
if (!file)
return -EBADF;
ret = compat_readv(file, vec, vlen, &pos);
+ fput_light(file, fput_needed);
unsigned long vlen)
{
struct file *file;
unsigned long vlen)
{
struct file *file;
+ file = fget_light(fd, &fput_needed);
if (!file)
return -EBADF;
ret = compat_writev(file, vec, vlen, &file->f_pos);
if (!file)
return -EBADF;
ret = compat_writev(file, vec, vlen, &file->f_pos);
+ fput_light(file, fput_needed);
{
loff_t pos = ((loff_t)pos_high << 32) | pos_low;
struct file *file;
{
loff_t pos = ((loff_t)pos_high << 32) | pos_low;
struct file *file;
ssize_t ret;
if (pos < 0)
return -EINVAL;
ssize_t ret;
if (pos < 0)
return -EINVAL;
+ file = fget_light(fd, &fput_needed);
if (!file)
return -EBADF;
ret = compat_writev(file, vec, vlen, &pos);
if (!file)
return -EBADF;
ret = compat_writev(file, vec, vlen, &pos);
+ fput_light(file, fput_needed);