Loading fs/nfs/nfs4file.c +14 −0 Original line number Diff line number Diff line Loading @@ -288,14 +288,28 @@ nfs42_ioctl_clone(struct file *dst_file, unsigned long srcfd, mnt_drop_write_file(dst_file); return ret; } static long nfs42_ioctl_clone_range(struct file *dst_file, void __user *argp) { struct nfs_ioctl_clone_range_args args; if (copy_from_user(&args, argp, sizeof(args))) return -EFAULT; return nfs42_ioctl_clone(dst_file, args.src_fd, args.src_off, args.dst_off, args.count); } #endif /* CONFIG_NFS_V4_2 */ long nfs4_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { void __user *argp = (void __user *)arg; switch (cmd) { #ifdef CONFIG_NFS_V4_2 case NFS_IOC_CLONE: return nfs42_ioctl_clone(file, arg, 0, 0, 0); case NFS_IOC_CLONE_RANGE: return nfs42_ioctl_clone_range(file, argp); #endif } Loading include/uapi/linux/nfs.h +8 −1 Original line number Diff line number Diff line Loading @@ -34,6 +34,13 @@ /* NFS ioctls */ /* Let's follow btrfs lead on CLONE to avoid messing userspace */ #define NFS_IOC_CLONE _IOW(0x94, 9, int) #define NFS_IOC_CLONE_RANGE _IOW(0x94, 13, int) struct nfs_ioctl_clone_range_args { __s64 src_fd; __u64 src_off, count; __u64 dst_off; }; /* * NFS stats. The good thing with these values is that NFSv3 errors are Loading Loading
fs/nfs/nfs4file.c +14 −0 Original line number Diff line number Diff line Loading @@ -288,14 +288,28 @@ nfs42_ioctl_clone(struct file *dst_file, unsigned long srcfd, mnt_drop_write_file(dst_file); return ret; } static long nfs42_ioctl_clone_range(struct file *dst_file, void __user *argp) { struct nfs_ioctl_clone_range_args args; if (copy_from_user(&args, argp, sizeof(args))) return -EFAULT; return nfs42_ioctl_clone(dst_file, args.src_fd, args.src_off, args.dst_off, args.count); } #endif /* CONFIG_NFS_V4_2 */ long nfs4_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { void __user *argp = (void __user *)arg; switch (cmd) { #ifdef CONFIG_NFS_V4_2 case NFS_IOC_CLONE: return nfs42_ioctl_clone(file, arg, 0, 0, 0); case NFS_IOC_CLONE_RANGE: return nfs42_ioctl_clone_range(file, argp); #endif } Loading
include/uapi/linux/nfs.h +8 −1 Original line number Diff line number Diff line Loading @@ -34,6 +34,13 @@ /* NFS ioctls */ /* Let's follow btrfs lead on CLONE to avoid messing userspace */ #define NFS_IOC_CLONE _IOW(0x94, 9, int) #define NFS_IOC_CLONE_RANGE _IOW(0x94, 13, int) struct nfs_ioctl_clone_range_args { __s64 src_fd; __u64 src_off, count; __u64 dst_off; }; /* * NFS stats. The good thing with these values is that NFSv3 errors are Loading