aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r--fs/btrfs/ioctl.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 338f2597bf7f..c3f09f71bedd 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -152,7 +152,7 @@ void btrfs_inherit_iflags(struct inode *inode, struct inode *dir)
152 152
153static int btrfs_ioctl_getflags(struct file *file, void __user *arg) 153static int btrfs_ioctl_getflags(struct file *file, void __user *arg)
154{ 154{
155 struct btrfs_inode *ip = BTRFS_I(file->f_path.dentry->d_inode); 155 struct btrfs_inode *ip = BTRFS_I(file_inode(file));
156 unsigned int flags = btrfs_flags_to_ioctl(ip->flags); 156 unsigned int flags = btrfs_flags_to_ioctl(ip->flags);
157 157
158 if (copy_to_user(arg, &flags, sizeof(flags))) 158 if (copy_to_user(arg, &flags, sizeof(flags)))
@@ -177,7 +177,7 @@ static int check_flags(unsigned int flags)
177 177
178static int btrfs_ioctl_setflags(struct file *file, void __user *arg) 178static int btrfs_ioctl_setflags(struct file *file, void __user *arg)
179{ 179{
180 struct inode *inode = file->f_path.dentry->d_inode; 180 struct inode *inode = file_inode(file);
181 struct btrfs_inode *ip = BTRFS_I(inode); 181 struct btrfs_inode *ip = BTRFS_I(inode);
182 struct btrfs_root *root = ip->root; 182 struct btrfs_root *root = ip->root;
183 struct btrfs_trans_handle *trans; 183 struct btrfs_trans_handle *trans;
@@ -310,7 +310,7 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg)
310 310
311static int btrfs_ioctl_getversion(struct file *file, int __user *arg) 311static int btrfs_ioctl_getversion(struct file *file, int __user *arg)
312{ 312{
313 struct inode *inode = file->f_path.dentry->d_inode; 313 struct inode *inode = file_inode(file);
314 314
315 return put_user(inode->i_generation, arg); 315 return put_user(inode->i_generation, arg);
316} 316}
@@ -1320,7 +1320,7 @@ static noinline int btrfs_ioctl_resize(struct file *file,
1320 u64 new_size; 1320 u64 new_size;
1321 u64 old_size; 1321 u64 old_size;
1322 u64 devid = 1; 1322 u64 devid = 1;
1323 struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 1323 struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
1324 struct btrfs_ioctl_vol_args *vol_args; 1324 struct btrfs_ioctl_vol_args *vol_args;
1325 struct btrfs_trans_handle *trans; 1325 struct btrfs_trans_handle *trans;
1326 struct btrfs_device *device = NULL; 1326 struct btrfs_device *device = NULL;
@@ -1489,8 +1489,8 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file,
1489 goto out_drop_write; 1489 goto out_drop_write;
1490 } 1490 }
1491 1491
1492 src_inode = src.file->f_path.dentry->d_inode; 1492 src_inode = file_inode(src.file);
1493 if (src_inode->i_sb != file->f_path.dentry->d_inode->i_sb) { 1493 if (src_inode->i_sb != file_inode(file)->i_sb) {
1494 printk(KERN_INFO "btrfs: Snapshot src from " 1494 printk(KERN_INFO "btrfs: Snapshot src from "
1495 "another FS\n"); 1495 "another FS\n");
1496 ret = -EINVAL; 1496 ret = -EINVAL;
@@ -1582,7 +1582,7 @@ out:
1582static noinline int btrfs_ioctl_subvol_getflags(struct file *file, 1582static noinline int btrfs_ioctl_subvol_getflags(struct file *file,
1583 void __user *arg) 1583 void __user *arg)
1584{ 1584{
1585 struct inode *inode = fdentry(file)->d_inode; 1585 struct inode *inode = file_inode(file);
1586 struct btrfs_root *root = BTRFS_I(inode)->root; 1586 struct btrfs_root *root = BTRFS_I(inode)->root;
1587 int ret = 0; 1587 int ret = 0;
1588 u64 flags = 0; 1588 u64 flags = 0;
@@ -1604,7 +1604,7 @@ static noinline int btrfs_ioctl_subvol_getflags(struct file *file,
1604static noinline int btrfs_ioctl_subvol_setflags(struct file *file, 1604static noinline int btrfs_ioctl_subvol_setflags(struct file *file,
1605 void __user *arg) 1605 void __user *arg)
1606{ 1606{
1607 struct inode *inode = fdentry(file)->d_inode; 1607 struct inode *inode = file_inode(file);
1608 struct btrfs_root *root = BTRFS_I(inode)->root; 1608 struct btrfs_root *root = BTRFS_I(inode)->root;
1609 struct btrfs_trans_handle *trans; 1609 struct btrfs_trans_handle *trans;
1610 u64 root_flags; 1610 u64 root_flags;
@@ -1898,7 +1898,7 @@ static noinline int btrfs_ioctl_tree_search(struct file *file,
1898 if (IS_ERR(args)) 1898 if (IS_ERR(args))
1899 return PTR_ERR(args); 1899 return PTR_ERR(args);
1900 1900
1901 inode = fdentry(file)->d_inode; 1901 inode = file_inode(file);
1902 ret = search_ioctl(inode, args); 1902 ret = search_ioctl(inode, args);
1903 if (ret == 0 && copy_to_user(argp, args, sizeof(*args))) 1903 if (ret == 0 && copy_to_user(argp, args, sizeof(*args)))
1904 ret = -EFAULT; 1904 ret = -EFAULT;
@@ -2008,7 +2008,7 @@ static noinline int btrfs_ioctl_ino_lookup(struct file *file,
2008 if (IS_ERR(args)) 2008 if (IS_ERR(args))
2009 return PTR_ERR(args); 2009 return PTR_ERR(args);
2010 2010
2011 inode = fdentry(file)->d_inode; 2011 inode = file_inode(file);
2012 2012
2013 if (args->treeid == 0) 2013 if (args->treeid == 0)
2014 args->treeid = BTRFS_I(inode)->root->root_key.objectid; 2014 args->treeid = BTRFS_I(inode)->root->root_key.objectid;
@@ -2184,7 +2184,7 @@ out:
2184 2184
2185static int btrfs_ioctl_defrag(struct file *file, void __user *argp) 2185static int btrfs_ioctl_defrag(struct file *file, void __user *argp)
2186{ 2186{
2187 struct inode *inode = fdentry(file)->d_inode; 2187 struct inode *inode = file_inode(file);
2188 struct btrfs_root *root = BTRFS_I(inode)->root; 2188 struct btrfs_root *root = BTRFS_I(inode)->root;
2189 struct btrfs_ioctl_defrag_range_args *range; 2189 struct btrfs_ioctl_defrag_range_args *range;
2190 int ret; 2190 int ret;
@@ -2244,7 +2244,7 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp)
2244 /* the rest are all set to zero by kzalloc */ 2244 /* the rest are all set to zero by kzalloc */
2245 range->len = (u64)-1; 2245 range->len = (u64)-1;
2246 } 2246 }
2247 ret = btrfs_defrag_file(fdentry(file)->d_inode, file, 2247 ret = btrfs_defrag_file(file_inode(file), file,
2248 range, 0, 0); 2248 range, 0, 0);
2249 if (ret > 0) 2249 if (ret > 0)
2250 ret = 0; 2250 ret = 0;
@@ -2292,7 +2292,7 @@ out:
2292 2292
2293static long btrfs_ioctl_rm_dev(struct file *file, void __user *arg) 2293static long btrfs_ioctl_rm_dev(struct file *file, void __user *arg)
2294{ 2294{
2295 struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 2295 struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
2296 struct btrfs_ioctl_vol_args *vol_args; 2296 struct btrfs_ioctl_vol_args *vol_args;
2297 int ret; 2297 int ret;
2298 2298
@@ -2415,7 +2415,7 @@ out:
2415static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, 2415static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
2416 u64 off, u64 olen, u64 destoff) 2416 u64 off, u64 olen, u64 destoff)
2417{ 2417{
2418 struct inode *inode = fdentry(file)->d_inode; 2418 struct inode *inode = file_inode(file);
2419 struct btrfs_root *root = BTRFS_I(inode)->root; 2419 struct btrfs_root *root = BTRFS_I(inode)->root;
2420 struct fd src_file; 2420 struct fd src_file;
2421 struct inode *src; 2421 struct inode *src;
@@ -2461,7 +2461,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
2461 if (src_file.file->f_path.mnt != file->f_path.mnt) 2461 if (src_file.file->f_path.mnt != file->f_path.mnt)
2462 goto out_fput; 2462 goto out_fput;
2463 2463
2464 src = src_file.file->f_dentry->d_inode; 2464 src = file_inode(src_file.file);
2465 2465
2466 ret = -EINVAL; 2466 ret = -EINVAL;
2467 if (src == inode) 2467 if (src == inode)
@@ -2823,7 +2823,7 @@ static long btrfs_ioctl_clone_range(struct file *file, void __user *argp)
2823 */ 2823 */
2824static long btrfs_ioctl_trans_start(struct file *file) 2824static long btrfs_ioctl_trans_start(struct file *file)
2825{ 2825{
2826 struct inode *inode = fdentry(file)->d_inode; 2826 struct inode *inode = file_inode(file);
2827 struct btrfs_root *root = BTRFS_I(inode)->root; 2827 struct btrfs_root *root = BTRFS_I(inode)->root;
2828 struct btrfs_trans_handle *trans; 2828 struct btrfs_trans_handle *trans;
2829 int ret; 2829 int ret;
@@ -2863,7 +2863,7 @@ out:
2863 2863
2864static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp) 2864static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp)
2865{ 2865{
2866 struct inode *inode = fdentry(file)->d_inode; 2866 struct inode *inode = file_inode(file);
2867 struct btrfs_root *root = BTRFS_I(inode)->root; 2867 struct btrfs_root *root = BTRFS_I(inode)->root;
2868 struct btrfs_root *new_root; 2868 struct btrfs_root *new_root;
2869 struct btrfs_dir_item *di; 2869 struct btrfs_dir_item *di;
@@ -3087,7 +3087,7 @@ out:
3087 */ 3087 */
3088long btrfs_ioctl_trans_end(struct file *file) 3088long btrfs_ioctl_trans_end(struct file *file)
3089{ 3089{
3090 struct inode *inode = fdentry(file)->d_inode; 3090 struct inode *inode = file_inode(file);
3091 struct btrfs_root *root = BTRFS_I(inode)->root; 3091 struct btrfs_root *root = BTRFS_I(inode)->root;
3092 struct btrfs_trans_handle *trans; 3092 struct btrfs_trans_handle *trans;
3093 3093
@@ -3149,7 +3149,7 @@ static noinline long btrfs_ioctl_wait_sync(struct btrfs_root *root,
3149 3149
3150static long btrfs_ioctl_scrub(struct file *file, void __user *arg) 3150static long btrfs_ioctl_scrub(struct file *file, void __user *arg)
3151{ 3151{
3152 struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 3152 struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
3153 struct btrfs_ioctl_scrub_args *sa; 3153 struct btrfs_ioctl_scrub_args *sa;
3154 int ret; 3154 int ret;
3155 3155
@@ -3440,7 +3440,7 @@ void update_ioctl_balance_args(struct btrfs_fs_info *fs_info, int lock,
3440 3440
3441static long btrfs_ioctl_balance(struct file *file, void __user *arg) 3441static long btrfs_ioctl_balance(struct file *file, void __user *arg)
3442{ 3442{
3443 struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 3443 struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
3444 struct btrfs_fs_info *fs_info = root->fs_info; 3444 struct btrfs_fs_info *fs_info = root->fs_info;
3445 struct btrfs_ioctl_balance_args *bargs; 3445 struct btrfs_ioctl_balance_args *bargs;
3446 struct btrfs_balance_control *bctl; 3446 struct btrfs_balance_control *bctl;
@@ -3630,7 +3630,7 @@ out:
3630 3630
3631static long btrfs_ioctl_quota_ctl(struct file *file, void __user *arg) 3631static long btrfs_ioctl_quota_ctl(struct file *file, void __user *arg)
3632{ 3632{
3633 struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 3633 struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
3634 struct btrfs_ioctl_quota_ctl_args *sa; 3634 struct btrfs_ioctl_quota_ctl_args *sa;
3635 struct btrfs_trans_handle *trans = NULL; 3635 struct btrfs_trans_handle *trans = NULL;
3636 int ret; 3636 int ret;
@@ -3689,7 +3689,7 @@ drop_write:
3689 3689
3690static long btrfs_ioctl_qgroup_assign(struct file *file, void __user *arg) 3690static long btrfs_ioctl_qgroup_assign(struct file *file, void __user *arg)
3691{ 3691{
3692 struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 3692 struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
3693 struct btrfs_ioctl_qgroup_assign_args *sa; 3693 struct btrfs_ioctl_qgroup_assign_args *sa;
3694 struct btrfs_trans_handle *trans; 3694 struct btrfs_trans_handle *trans;
3695 int ret; 3695 int ret;
@@ -3736,7 +3736,7 @@ drop_write:
3736 3736
3737static long btrfs_ioctl_qgroup_create(struct file *file, void __user *arg) 3737static long btrfs_ioctl_qgroup_create(struct file *file, void __user *arg)
3738{ 3738{
3739 struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 3739 struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
3740 struct btrfs_ioctl_qgroup_create_args *sa; 3740 struct btrfs_ioctl_qgroup_create_args *sa;
3741 struct btrfs_trans_handle *trans; 3741 struct btrfs_trans_handle *trans;
3742 int ret; 3742 int ret;
@@ -3787,7 +3787,7 @@ drop_write:
3787 3787
3788static long btrfs_ioctl_qgroup_limit(struct file *file, void __user *arg) 3788static long btrfs_ioctl_qgroup_limit(struct file *file, void __user *arg)
3789{ 3789{
3790 struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 3790 struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
3791 struct btrfs_ioctl_qgroup_limit_args *sa; 3791 struct btrfs_ioctl_qgroup_limit_args *sa;
3792 struct btrfs_trans_handle *trans; 3792 struct btrfs_trans_handle *trans;
3793 int ret; 3793 int ret;
@@ -3837,7 +3837,7 @@ static long btrfs_ioctl_set_received_subvol(struct file *file,
3837 void __user *arg) 3837 void __user *arg)
3838{ 3838{
3839 struct btrfs_ioctl_received_subvol_args *sa = NULL; 3839 struct btrfs_ioctl_received_subvol_args *sa = NULL;
3840 struct inode *inode = fdentry(file)->d_inode; 3840 struct inode *inode = file_inode(file);
3841 struct btrfs_root *root = BTRFS_I(inode)->root; 3841 struct btrfs_root *root = BTRFS_I(inode)->root;
3842 struct btrfs_root_item *root_item = &root->root_item; 3842 struct btrfs_root_item *root_item = &root->root_item;
3843 struct btrfs_trans_handle *trans; 3843 struct btrfs_trans_handle *trans;
@@ -3917,7 +3917,7 @@ out:
3917long btrfs_ioctl(struct file *file, unsigned int 3917long btrfs_ioctl(struct file *file, unsigned int
3918 cmd, unsigned long arg) 3918 cmd, unsigned long arg)
3919{ 3919{
3920 struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 3920 struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
3921 void __user *argp = (void __user *)arg; 3921 void __user *argp = (void __user *)arg;
3922 3922
3923 switch (cmd) { 3923 switch (cmd) {