From mboxrd@z Thu Jan 1 00:00:00 1970 From: Namhyung Kim Subject: [PATCH 2/2] vfs: Get rid of duplicate file_ops check in do_readv_writev() Date: Sun, 29 Sep 2013 18:37:50 +0900 Message-ID: <1380447470-2811-2-git-send-email-namhyung@kernel.org> References: <1380447470-2811-1-git-send-email-namhyung@kernel.org> Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Alexander Viro Return-path: In-Reply-To: <1380447470-2811-1-git-send-email-namhyung@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org The file->f_op check in do_readv_writev() is redundant since all of its caller (vfs_readv and vfs_writev) already did the check. The same goes to compat_do_readv_writev(). Signed-off-by: Namhyung Kim --- fs/read_write.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/fs/read_write.c b/fs/read_write.c index 878f40e50451..a8bcdd26b16e 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -721,11 +721,6 @@ static ssize_t do_readv_writev(int type, struct file *file, io_fn_t fn; iov_fn_t fnv; - if (!file->f_op) { - ret = -EINVAL; - goto out; - } - ret = rw_copy_check_uvector(type, uvector, nr_segs, ARRAY_SIZE(iovstack), iovstack, &iov); if (ret <= 0) @@ -894,10 +889,6 @@ static ssize_t compat_do_readv_writev(int type, struct file *file, io_fn_t fn; iov_fn_t fnv; - ret = -EINVAL; - if (!file->f_op) - goto out; - ret = -EFAULT; if (!access_ok(VERIFY_READ, uvector, nr_segs*sizeof(*uvector))) goto out; -- 1.7.9.2