Re: [PATCH 3/2] xfs_io: copy_file_range length is a size_t

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 03, 2018 at 11:20:36AM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
> 
> 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@xxxxxxxxxx>

Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>

--D

> ---
>  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;
>  			}
> 



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux