public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: linux-xfs@vger.kernel.org
Subject: [PATCH 3/2] xfs_io: copy_file_range length is a size_t
Date: Mon, 3 Dec 2018 11:20:36 +1100	[thread overview]
Message-ID: <20181203002036.GB6311@dastard> (raw)
In-Reply-To: <20181202205343.7104-1-david@fromorbit.com>

From: Dave Chinner <dchinner@redhat.com>

copy_file_range() takes a size_t as it's length, not a "long long".
Therefore we need to be able to pass sizes larger than 8EB to it
to be able to test the interface fully and that requires copy_range
to accept all values except an explicit error value of "-1LL".

Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 io/copy_file_range.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/io/copy_file_range.c b/io/copy_file_range.c
index f118a3bfd506..4e2969c9ca47 100644
--- a/io/copy_file_range.c
+++ b/io/copy_file_range.c
@@ -34,7 +34,7 @@ copy_range_help(void)
  * glibc buffered copy fallback.
  */
 static loff_t
-copy_file_range_cmd(int fd, long long *src, long long *dst, long long len)
+copy_file_range_cmd(int fd, long long *src, long long *dst, size_t len)
 {
 	loff_t ret;
 
@@ -78,7 +78,7 @@ copy_range_f(int argc, char **argv)
 {
 	long long src = 0;
 	long long dst = 0;
-	long long len = 0;
+	size_t len = 0;
 	int opt;
 	int ret;
 	int fd;
@@ -104,7 +104,7 @@ copy_range_f(int argc, char **argv)
 			break;
 		case 'l':
 			len = cvtnum(fsblocksize, fssectsize, optarg);
-			if (len < 0) {
+			if (len == -1LL) {
 				printf(_("invalid length -- %s\n"), optarg);
 				return 0;
 			}

  parent reply	other threads:[~2018-12-03  0:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-02 20:53 [PATCH 0/2] xfs_io: additions for testing copy_range Dave Chinner
2018-12-02 20:53 ` [PATCH 1/2] io: open pipes in non-blocking mode Dave Chinner
2018-12-03 10:07   ` Jan Tulak
2018-12-03 16:20   ` Darrick J. Wong
2018-12-03 20:16     ` Dave Chinner
2018-12-05  3:52       ` Eric Sandeen
2018-12-02 20:53 ` [PATCH 2/2] xfs_io: allow open file permissions to be changed Dave Chinner
2018-12-03 10:17   ` Jan Tulak
2018-12-03 20:14     ` Dave Chinner
2018-12-03 16:24   ` Darrick J. Wong
2018-12-05  4:02   ` [PATCH 2/2 V2] " Dave Chinner
2018-12-05  4:23     ` Eric Sandeen
2018-12-05  4:04   ` [PATCH 2/2] " Eric Sandeen
2018-12-03  0:20 ` Dave Chinner [this message]
2018-12-03 10:08   ` [PATCH 3/2] xfs_io: copy_file_range length is a size_t Jan Tulak
2018-12-03 16:27   ` Darrick J. Wong

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=20181203002036.GB6311@dastard \
    --to=david@fromorbit.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