From: akpm@linux-foundation.org
To: torvalds@linux-foundation.org
Cc: akpm@linux-foundation.org, kraxel@redhat.com, arnd@arndb.de,
linux-api@vger.kernel.org, linux-arch@vger.kernel.org,
ralf@linux-mips.org, viro@zeniv.linux.org.uk
Subject: [patch 145/166] preadv/pwritev: switch compat readv/preadv/writev/pwritev from fget to fget_light
Date: Thu, 02 Apr 2009 16:59:25 -0700 [thread overview]
Message-ID: <200904022359.n32NxPFh022843@imap1.linux-foundation.org> (raw)
From: Gerd Hoffmann <kraxel@redhat.com>
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>
---
fs/compat.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff -puN fs/compat.c~preadv-pwritev-switch-compat-readv-preadv-writev-pwritev-from-fget-to-fget_light fs/compat.c
--- a/fs/compat.c~preadv-pwritev-switch-compat-readv-preadv-writev-pwritev-from-fget-to-fget_light
+++ a/fs/compat.c
@@ -1222,13 +1222,14 @@ compat_sys_readv(unsigned long fd, const
unsigned long vlen)
{
struct file *file;
+ int fput_needed;
ssize_t ret;
- file = fget(fd);
+ file = fget_light(fd, &fput_needed);
if (!file)
return -EBADF;
ret = compat_readv(file, vec, vlen, &file->f_pos);
- fput(file);
+ fput_light(file, fput_needed);
return ret;
}
@@ -1238,15 +1239,16 @@ compat_sys_preadv(unsigned long fd, cons
{
loff_t pos = ((loff_t)pos_high << 32) | pos_low;
struct file *file;
+ int fput_needed;
ssize_t ret;
if (pos < 0)
return -EINVAL;
- file = fget(fd);
+ file = fget_light(fd, &fput_needed);
if (!file)
return -EBADF;
ret = compat_readv(file, vec, vlen, &pos);
- fput(file);
+ fput_light(file, fput_needed);
return ret;
}
@@ -1277,13 +1279,14 @@ compat_sys_writev(unsigned long fd, cons
unsigned long vlen)
{
struct file *file;
+ int fput_needed;
ssize_t ret;
- file = fget(fd);
+ file = fget_light(fd, &fput_needed);
if (!file)
return -EBADF;
ret = compat_writev(file, vec, vlen, &file->f_pos);
- fput(file);
+ fput_light(file, fput_needed);
return ret;
}
@@ -1293,15 +1296,16 @@ compat_sys_pwritev(unsigned long fd, con
{
loff_t pos = ((loff_t)pos_high << 32) | pos_low;
struct file *file;
+ int fput_needed;
ssize_t ret;
if (pos < 0)
return -EINVAL;
- file = fget(fd);
+ file = fget_light(fd, &fput_needed);
if (!file)
return -EBADF;
ret = compat_writev(file, vec, vlen, &pos);
- fput(file);
+ fput_light(file, fput_needed);
return ret;
}
_
reply other threads:[~2009-04-02 23:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200904022359.n32NxPFh022843@imap1.linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=kraxel@redhat.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=ralf@linux-mips.org \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).