mirror of https://github.com/torvalds/linux.git
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>
This commit is contained in:
parent
5e54f9420f
commit
4e043cd196
|
|
@ -4385,7 +4385,7 @@ static int btrfs_ioctl_set_features(struct file *file, void __user *arg)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int _btrfs_ioctl_send(struct btrfs_inode *inode, void __user *argp, bool compat)
|
||||
static int _btrfs_ioctl_send(struct btrfs_root *root, void __user *argp, bool compat)
|
||||
{
|
||||
struct btrfs_ioctl_send_args *arg;
|
||||
int ret;
|
||||
|
|
@ -4416,7 +4416,7 @@ static int _btrfs_ioctl_send(struct btrfs_inode *inode, void __user *argp, bool
|
|||
if (IS_ERR(arg))
|
||||
return PTR_ERR(arg);
|
||||
}
|
||||
ret = btrfs_ioctl_send(inode, arg);
|
||||
ret = btrfs_ioctl_send(root, arg);
|
||||
kfree(arg);
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -5315,10 +5315,10 @@ long btrfs_ioctl(struct file *file, unsigned int
|
|||
return btrfs_ioctl_set_received_subvol_32(file, argp);
|
||||
#endif
|
||||
case BTRFS_IOC_SEND:
|
||||
return _btrfs_ioctl_send(BTRFS_I(inode), argp, false);
|
||||
return _btrfs_ioctl_send(root, argp, false);
|
||||
#if defined(CONFIG_64BIT) && defined(CONFIG_COMPAT)
|
||||
case BTRFS_IOC_SEND_32:
|
||||
return _btrfs_ioctl_send(BTRFS_I(inode), argp, true);
|
||||
return _btrfs_ioctl_send(root, argp, true);
|
||||
#endif
|
||||
case BTRFS_IOC_GET_DEV_STATS:
|
||||
return btrfs_ioctl_get_dev_stats(fs_info, argp);
|
||||
|
|
|
|||
|
|
@ -8077,10 +8077,9 @@ static void dedupe_in_progress_warn(const struct btrfs_root *root)
|
|||
btrfs_root_id(root), root->dedupe_in_progress);
|
||||
}
|
||||
|
||||
long btrfs_ioctl_send(struct btrfs_inode *inode, const struct btrfs_ioctl_send_args *arg)
|
||||
long btrfs_ioctl_send(struct btrfs_root *send_root, const struct btrfs_ioctl_send_args *arg)
|
||||
{
|
||||
int ret = 0;
|
||||
struct btrfs_root *send_root = inode->root;
|
||||
struct btrfs_fs_info *fs_info = send_root->fs_info;
|
||||
struct btrfs_root *clone_root;
|
||||
struct send_ctx *sctx = NULL;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include <linux/sizes.h>
|
||||
#include <linux/align.h>
|
||||
|
||||
struct btrfs_inode;
|
||||
struct btrfs_root;
|
||||
struct btrfs_ioctl_send_args;
|
||||
|
||||
#define BTRFS_SEND_STREAM_MAGIC "btrfs-stream"
|
||||
|
|
@ -182,6 +182,6 @@ enum {
|
|||
__BTRFS_SEND_A_MAX = 35,
|
||||
};
|
||||
|
||||
long btrfs_ioctl_send(struct btrfs_inode *inode, const struct btrfs_ioctl_send_args *arg);
|
||||
long btrfs_ioctl_send(struct btrfs_root *send_root, const struct btrfs_ioctl_send_args *arg);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue