All of lore.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
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	[thread overview]
Message-ID: <1380447470-2811-2-git-send-email-namhyung@kernel.org> (raw)
In-Reply-To: <1380447470-2811-1-git-send-email-namhyung@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 <namhyung@kernel.org>
---
 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

  reply	other threads:[~2013-09-29  9:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-29  9:37 [PATCH 1/2] vfs: Get rid of duplicate offset checks in p{read,write}* Namhyung Kim
2013-09-29  9:37 ` Namhyung Kim [this message]
2013-09-29 22:24   ` [PATCH 2/2] vfs: Get rid of duplicate file_ops check in do_readv_writev() Al Viro

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=1380447470-2811-2-git-send-email-namhyung@kernel.org \
    --to=namhyung@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.