Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935662AbZAPQs1 (ORCPT ); Fri, 16 Jan 2009 11:48:27 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760218AbZAPQqI (ORCPT ); Fri, 16 Jan 2009 11:46:08 -0500 Received: from mx2.redhat.com ([66.187.237.31]:39237 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756853AbZAPQqA (ORCPT ); Fri, 16 Jan 2009 11:46:00 -0500 From: Gerd Hoffmann To: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org Cc: aarcange@redhat.com, Gerd Hoffmann Subject: [PATCH 5/5] switch compat readv/preadv/writev/pwritev from fget to fget_light Date: Fri, 16 Jan 2009 17:45:44 +0100 Message-Id: <1232124344-25892-6-git-send-email-kraxel@redhat.com> In-Reply-To: <1232124344-25892-1-git-send-email-kraxel@redhat.com> References: <1232124344-25892-1-git-send-email-kraxel@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2233 Lines: 90 Signed-off-by: Gerd Hoffmann --- fs/compat.c | 20 ++++++++++++-------- 1 files changed, 12 insertions(+), 8 deletions(-) diff --git a/fs/compat.c b/fs/compat.c index 20fec0e..90a10e9 100644 --- a/fs/compat.c +++ b/fs/compat.c @@ -1192,13 +1192,14 @@ asmlinkage ssize_t compat_sys_readv(unsigned long fd, const struct compat_iovec __user *vec, 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; } @@ -1208,15 +1209,16 @@ compat_sys_preadv(unsigned long fd, const struct compat_iovec __user *vec, { 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; } @@ -1245,13 +1247,14 @@ asmlinkage ssize_t compat_sys_writev(unsigned long fd, const struct compat_iovec __user *vec, 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; } @@ -1261,15 +1264,16 @@ compat_sys_pwritev(unsigned long fd, const struct compat_iovec __user *vec, { 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; } -- 1.6.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/