Commit 9a8c28be authored by Miao Xie's avatar Miao Xie Committed by Chris Mason

Btrfs: pass root object into btrfs_ioctl_{start, wait}_sync()

Since we have gotten the root in the caller, just pass it into
btrfs_ioctl_{start, wait}_sync() directly.
Signed-off-by: default avatarMiao Xie <miaox@cn.fujitsu.com>
Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
parent db2254bc
...@@ -3058,9 +3058,9 @@ long btrfs_ioctl_trans_end(struct file *file) ...@@ -3058,9 +3058,9 @@ long btrfs_ioctl_trans_end(struct file *file)
return 0; return 0;
} }
static noinline long btrfs_ioctl_start_sync(struct file *file, void __user *argp) static noinline long btrfs_ioctl_start_sync(struct btrfs_root *root,
void __user *argp)
{ {
struct btrfs_root *root = BTRFS_I(file->f_dentry->d_inode)->root;
struct btrfs_trans_handle *trans; struct btrfs_trans_handle *trans;
u64 transid; u64 transid;
int ret; int ret;
...@@ -3081,9 +3081,9 @@ static noinline long btrfs_ioctl_start_sync(struct file *file, void __user *argp ...@@ -3081,9 +3081,9 @@ static noinline long btrfs_ioctl_start_sync(struct file *file, void __user *argp
return 0; return 0;
} }
static noinline long btrfs_ioctl_wait_sync(struct file *file, void __user *argp) static noinline long btrfs_ioctl_wait_sync(struct btrfs_root *root,
void __user *argp)
{ {
struct btrfs_root *root = BTRFS_I(file->f_dentry->d_inode)->root;
u64 transid; u64 transid;
if (argp) { if (argp) {
...@@ -3843,9 +3843,9 @@ long btrfs_ioctl(struct file *file, unsigned int ...@@ -3843,9 +3843,9 @@ long btrfs_ioctl(struct file *file, unsigned int
btrfs_sync_fs(file->f_dentry->d_sb, 1); btrfs_sync_fs(file->f_dentry->d_sb, 1);
return 0; return 0;
case BTRFS_IOC_START_SYNC: case BTRFS_IOC_START_SYNC:
return btrfs_ioctl_start_sync(file, argp); return btrfs_ioctl_start_sync(root, argp);
case BTRFS_IOC_WAIT_SYNC: case BTRFS_IOC_WAIT_SYNC:
return btrfs_ioctl_wait_sync(file, argp); return btrfs_ioctl_wait_sync(root, argp);
case BTRFS_IOC_SCRUB: case BTRFS_IOC_SCRUB:
return btrfs_ioctl_scrub(root, argp); return btrfs_ioctl_scrub(root, argp);
case BTRFS_IOC_SCRUB_CANCEL: case BTRFS_IOC_SCRUB_CANCEL:
......
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