Skip to content

Commit

Permalink
Btrfs: btrfs: pass void __user * to btrfs_ioctl_clone_range
Browse files Browse the repository at this point in the history
Cleans the code up a little and also avoids a sparse warning due to the
incorrect cast in the current version of the code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Christoph Hellwig authored and Chris Mason committed Dec 2, 2008
1 parent 4bcabaa commit 7a865e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/btrfs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1035,11 +1035,11 @@ static long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
return ret;
}

static long btrfs_ioctl_clone_range(struct file *file, unsigned long argptr)
static long btrfs_ioctl_clone_range(struct file *file, void __user *argp)
{
struct btrfs_ioctl_clone_range_args args;

if (copy_from_user(&args, (void *)argptr, sizeof(args)))
if (copy_from_user(&args, argp, sizeof(args)))
return -EFAULT;
return btrfs_ioctl_clone(file, args.src_fd, args.src_offset,
args.src_length, args.dest_offset);
Expand Down Expand Up @@ -1137,7 +1137,7 @@ long btrfs_ioctl(struct file *file, unsigned int
case BTRFS_IOC_CLONE:
return btrfs_ioctl_clone(file, arg, 0, 0, 0);
case BTRFS_IOC_CLONE_RANGE:
return btrfs_ioctl_clone_range(file, arg);
return btrfs_ioctl_clone_range(file, argp);
case BTRFS_IOC_TRANS_START:
return btrfs_ioctl_trans_start(file);
case BTRFS_IOC_TRANS_END:
Expand Down

0 comments on commit 7a865e8

Please sign in to comment.