Commit 24e74598 authored by David Sterba's avatar David Sterba

btrfs: pass a btrfs_inode to btrfs_ioctl_send()

Pass a struct btrfs_inode to btrfs_ioctl_send() and _btrfs_ioctl_send()
as it's an internal interface, allowing to remove some use of BTRFS_I.
Reviewed-by: default avatarBoris Burkov <boris@bur.io>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent e108c86b
...@@ -4473,7 +4473,7 @@ static int btrfs_ioctl_set_features(struct file *file, void __user *arg) ...@@ -4473,7 +4473,7 @@ static int btrfs_ioctl_set_features(struct file *file, void __user *arg)
return ret; return ret;
} }
static int _btrfs_ioctl_send(struct inode *inode, void __user *argp, bool compat) static int _btrfs_ioctl_send(struct btrfs_inode *inode, void __user *argp, bool compat)
{ {
struct btrfs_ioctl_send_args *arg; struct btrfs_ioctl_send_args *arg;
int ret; int ret;
...@@ -4795,10 +4795,10 @@ long btrfs_ioctl(struct file *file, unsigned int ...@@ -4795,10 +4795,10 @@ long btrfs_ioctl(struct file *file, unsigned int
return btrfs_ioctl_set_received_subvol_32(file, argp); return btrfs_ioctl_set_received_subvol_32(file, argp);
#endif #endif
case BTRFS_IOC_SEND: case BTRFS_IOC_SEND:
return _btrfs_ioctl_send(inode, argp, false); return _btrfs_ioctl_send(BTRFS_I(inode), argp, false);
#if defined(CONFIG_64BIT) && defined(CONFIG_COMPAT) #if defined(CONFIG_64BIT) && defined(CONFIG_COMPAT)
case BTRFS_IOC_SEND_32: case BTRFS_IOC_SEND_32:
return _btrfs_ioctl_send(inode, argp, true); return _btrfs_ioctl_send(BTRFS_I(inode), argp, true);
#endif #endif
case BTRFS_IOC_GET_DEV_STATS: case BTRFS_IOC_GET_DEV_STATS:
return btrfs_ioctl_get_dev_stats(fs_info, argp); return btrfs_ioctl_get_dev_stats(fs_info, argp);
......
...@@ -8065,10 +8065,10 @@ static void dedupe_in_progress_warn(const struct btrfs_root *root) ...@@ -8065,10 +8065,10 @@ static void dedupe_in_progress_warn(const struct btrfs_root *root)
btrfs_root_id(root), root->dedupe_in_progress); btrfs_root_id(root), root->dedupe_in_progress);
} }
long btrfs_ioctl_send(struct inode *inode, const struct btrfs_ioctl_send_args *arg) long btrfs_ioctl_send(struct btrfs_inode *inode, const struct btrfs_ioctl_send_args *arg)
{ {
int ret = 0; int ret = 0;
struct btrfs_root *send_root = BTRFS_I(inode)->root; struct btrfs_root *send_root = inode->root;
struct btrfs_fs_info *fs_info = send_root->fs_info; struct btrfs_fs_info *fs_info = send_root->fs_info;
struct btrfs_root *clone_root; struct btrfs_root *clone_root;
struct send_ctx *sctx = NULL; struct send_ctx *sctx = NULL;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include <linux/sizes.h> #include <linux/sizes.h>
#include <linux/align.h> #include <linux/align.h>
struct inode; struct btrfs_inode;
struct btrfs_ioctl_send_args; struct btrfs_ioctl_send_args;
#define BTRFS_SEND_STREAM_MAGIC "btrfs-stream" #define BTRFS_SEND_STREAM_MAGIC "btrfs-stream"
...@@ -182,6 +182,6 @@ enum { ...@@ -182,6 +182,6 @@ enum {
__BTRFS_SEND_A_MAX = 35, __BTRFS_SEND_A_MAX = 35,
}; };
long btrfs_ioctl_send(struct inode *inode, const struct btrfs_ioctl_send_args *arg); long btrfs_ioctl_send(struct btrfs_inode *inode, const struct btrfs_ioctl_send_args *arg);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment