linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zorro Lang <zlang@redhat.com>
To: linux-xfs@vger.kernel.org
Subject: [PATCH 3/3] xfsprogs: remove useless do_preadv and do_pwritev arguments
Date: Sun, 12 Nov 2017 01:21:55 +0800	[thread overview]
Message-ID: <20171111172155.31941-3-zlang@redhat.com> (raw)
In-Reply-To: <20171111172155.31941-1-zlang@redhat.com>

do_preadv and do_pwritev all have a 'buffer_size' argument, but they
never used it. Instead of it, they use global 'buffersize' variable,
which is initialized in alloc_buffer(). As the 'buffer_size' is
useless, so remove it for clear code.

Signed-off-by: Zorro Lang <zlang@redhat.com>
---
 io/pread.c  | 7 +++----
 io/pwrite.c | 5 ++---
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/io/pread.c b/io/pread.c
index 60650aa3..98e992b0 100644
--- a/io/pread.c
+++ b/io/pread.c
@@ -176,8 +176,7 @@ static ssize_t
 do_preadv(
 	int		fd,
 	off64_t		offset,
-	size_t		count,
-	size_t		buffer_size)
+	size_t		count)
 {
 	int		vecs = 0;
 	ssize_t		oldlen = 0;
@@ -205,7 +204,7 @@ do_preadv(
 	return bytes;
 }
 #else
-#define do_preadv(fd, offset, count, buffer_size) (0)
+#define do_preadv(fd, offset, count) (0)
 #endif
 
 static ssize_t
@@ -218,7 +217,7 @@ do_pread(
 	if (!vectors)
 		return pread(fd, buffer, min(count, buffer_size), offset);
 
-	return do_preadv(fd, offset, count, buffer_size);
+	return do_preadv(fd, offset, count);
 }
 
 static int
diff --git a/io/pwrite.c b/io/pwrite.c
index a89edfd0..f75c6164 100644
--- a/io/pwrite.c
+++ b/io/pwrite.c
@@ -66,7 +66,6 @@ do_pwritev(
 	int		fd,
 	off64_t		offset,
 	size_t		count,
-	size_t		buffer_size,
 	int 		pwritev2_flags)
 {
 	int vecs = 0;
@@ -102,7 +101,7 @@ do_pwritev(
 	return bytes;
 }
 #else
-#define do_pwritev(fd, offset, count, buffer_size, pwritev2_flags) (0)
+#define do_pwritev(fd, offset, count, pwritev2_flags) (0)
 #endif
 
 static ssize_t
@@ -116,7 +115,7 @@ do_pwrite(
 	if (!vectors)
 		return pwrite(fd, buffer, min(count, buffer_size), offset);
 
-	return do_pwritev(fd, offset, count, buffer_size, pwritev2_flags);
+	return do_pwritev(fd, offset, count, pwritev2_flags);
 }
 
 static int
-- 
2.13.6


  parent reply	other threads:[~2017-11-11 17:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-11 17:21 [PATCH 1/3] xfsprogs: fix wrong variable type in write_once function Zorro Lang
2017-11-11 17:21 ` [PATCH 2/3] xfsprogs: fix wrong do_pwritev definition Zorro Lang
2017-11-16 20:33   ` Eric Sandeen
2017-11-11 17:21 ` Zorro Lang [this message]
2017-11-16 20:34   ` [PATCH 3/3] xfsprogs: remove useless do_preadv and do_pwritev arguments Eric Sandeen
2018-09-27 18:38   ` Eric Sandeen
2018-09-28  1:39     ` Zorro Lang
2017-11-16 20:33 ` [PATCH 1/3] xfsprogs: fix wrong variable type in write_once function Eric Sandeen

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=20171111172155.31941-3-zlang@redhat.com \
    --to=zlang@redhat.com \
    --cc=linux-xfs@vger.kernel.org \
    /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).