Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

btrfs: pass btrfs_root pointers to send ioctl parameters

The ioctl switch btrfs_ioctl() provides several parameter types for
convenience so we don't have to do the conversion in the callbacks.
Pass root pointers to the send related functions.

Signed-off-by: David Sterba <dsterba@suse.com>

+7 -8
+4 -4
fs/btrfs/ioctl.c
··· 4385 4385 return ret; 4386 4386 } 4387 4387 4388 - static int _btrfs_ioctl_send(struct btrfs_inode *inode, void __user *argp, bool compat) 4388 + static int _btrfs_ioctl_send(struct btrfs_root *root, void __user *argp, bool compat) 4389 4389 { 4390 4390 struct btrfs_ioctl_send_args *arg; 4391 4391 int ret; ··· 4416 4416 if (IS_ERR(arg)) 4417 4417 return PTR_ERR(arg); 4418 4418 } 4419 - ret = btrfs_ioctl_send(inode, arg); 4419 + ret = btrfs_ioctl_send(root, arg); 4420 4420 kfree(arg); 4421 4421 return ret; 4422 4422 } ··· 5315 5315 return btrfs_ioctl_set_received_subvol_32(file, argp); 5316 5316 #endif 5317 5317 case BTRFS_IOC_SEND: 5318 - return _btrfs_ioctl_send(BTRFS_I(inode), argp, false); 5318 + return _btrfs_ioctl_send(root, argp, false); 5319 5319 #if defined(CONFIG_64BIT) && defined(CONFIG_COMPAT) 5320 5320 case BTRFS_IOC_SEND_32: 5321 - return _btrfs_ioctl_send(BTRFS_I(inode), argp, true); 5321 + return _btrfs_ioctl_send(root, argp, true); 5322 5322 #endif 5323 5323 case BTRFS_IOC_GET_DEV_STATS: 5324 5324 return btrfs_ioctl_get_dev_stats(fs_info, argp);
+1 -2
fs/btrfs/send.c
··· 8077 8077 btrfs_root_id(root), root->dedupe_in_progress); 8078 8078 } 8079 8079 8080 - long btrfs_ioctl_send(struct btrfs_inode *inode, const struct btrfs_ioctl_send_args *arg) 8080 + long btrfs_ioctl_send(struct btrfs_root *send_root, const struct btrfs_ioctl_send_args *arg) 8081 8081 { 8082 8082 int ret = 0; 8083 - struct btrfs_root *send_root = inode->root; 8084 8083 struct btrfs_fs_info *fs_info = send_root->fs_info; 8085 8084 struct btrfs_root *clone_root; 8086 8085 struct send_ctx *sctx = NULL;
+2 -2
fs/btrfs/send.h
··· 11 11 #include <linux/sizes.h> 12 12 #include <linux/align.h> 13 13 14 - struct btrfs_inode; 14 + struct btrfs_root; 15 15 struct btrfs_ioctl_send_args; 16 16 17 17 #define BTRFS_SEND_STREAM_MAGIC "btrfs-stream" ··· 182 182 __BTRFS_SEND_A_MAX = 35, 183 183 }; 184 184 185 - long btrfs_ioctl_send(struct btrfs_inode *inode, const struct btrfs_ioctl_send_args *arg); 185 + long btrfs_ioctl_send(struct btrfs_root *send_root, const struct btrfs_ioctl_send_args *arg); 186 186 187 187 #endif