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 4b4516770f05..61045adc3075 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}
@@ -1317,7 +1317,7 @@ static noinline int btrfs_ioctl_resize(struct file *file,
1317 u64 new_size; 1317 u64 new_size;
1318 u64 old_size; 1318 u64 old_size;
1319 u64 devid = 1; 1319 u64 devid = 1;
1320 struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 1320 struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
1321 struct btrfs_ioctl_vol_args *vol_args; 1321 struct btrfs_ioctl_vol_args *vol_args;
1322 struct btrfs_trans_handle *trans; 1322 struct btrfs_trans_handle *trans;
1323 struct btrfs_device *device = NULL; 1323 struct btrfs_device *device = NULL;
@@ -1483,8 +1483,8 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file,
1483 goto out_drop_write; 1483 goto out_drop_write;
1484 } 1484 }
1485 1485
1486 src_inode = src.file->f_path.dentry->d_inode; 1486 src_inode = file_inode(src.file);
1487 if (src_inode->i_sb != file->f_path.dentry->d_inode->i_sb) { 1487 if (src_inode->i_sb != file_inode(file)->i_sb) {
1488 printk(KERN_INFO "btrfs: Snapshot src from " 1488 printk(KERN_INFO "btrfs: Snapshot src from "
1489 "another FS\n"); 1489 "another FS\n");
1490 ret = -EINVAL; 1490 ret = -EINVAL;
@@ -1576,7 +1576,7 @@ out:
1576static noinline int btrfs_ioctl_subvol_getflags(struct file *file, 1576static noinline int btrfs_ioctl_subvol_getflags(struct file *file,
1577 void __user *arg) 1577 void __user *arg)
1578{ 1578{
1579 struct inode *inode = fdentry(file)->d_inode; 1579 struct inode *inode = file_inode(file);
1580 struct btrfs_root *root = BTRFS_I(inode)->root; 1580 struct btrfs_root *root = BTRFS_I(inode)->root;
1581 int ret = 0; 1581 int ret = 0;
1582 u64 flags = 0; 1582 u64 flags = 0;
@@ -1598,7 +1598,7 @@ static noinline int btrfs_ioctl_subvol_getflags(struct file *file,
1598static noinline int btrfs_ioctl_subvol_setflags(struct file *file, 1598static noinline int btrfs_ioctl_subvol_setflags(struct file *file,
1599 void __user *arg) 1599 void __user *arg)
1600{ 1600{
1601 struct inode *inode = fdentry(file)->d_inode; 1601 struct inode *inode = file_inode(file);
1602 struct btrfs_root *root = BTRFS_I(inode)->root; 1602 struct btrfs_root *root = BTRFS_I(inode)->root;
1603 struct btrfs_trans_handle *trans; 1603 struct btrfs_trans_handle *trans;
1604 u64 root_flags; 1604 u64 root_flags;
@@ -1892,7 +1892,7 @@ static noinline int btrfs_ioctl_tree_search(struct file *file,
1892 if (IS_ERR(args)) 1892 if (IS_ERR(args))
1893 return PTR_ERR(args); 1893 return PTR_ERR(args);
1894 1894
1895 inode = fdentry(file)->d_inode; 1895 inode = file_inode(file);
1896 ret = search_ioctl(inode, args); 1896 ret = search_ioctl(inode, args);
1897 if (ret == 0 && copy_to_user(argp, args, sizeof(*args))) 1897 if (ret == 0 && copy_to_user(argp, args, sizeof(*args)))
1898 ret = -EFAULT; 1898 ret = -EFAULT;
@@ -2002,7 +2002,7 @@ static noinline int btrfs_ioctl_ino_lookup(struct file *file,
2002 if (IS_ERR(args)) 2002 if (IS_ERR(args))
2003 return PTR_ERR(args); 2003 return PTR_ERR(args);
2004 2004
2005 inode = fdentry(file)->d_inode; 2005 inode = file_inode(file);
2006 2006
2007 if (args->treeid == 0) 2007 if (args->treeid == 0)
2008 args->treeid = BTRFS_I(inode)->root->root_key.objectid; 2008 args->treeid = BTRFS_I(inode)->root->root_key.objectid;
@@ -2178,7 +2178,7 @@ out:
2178 2178
2179static int btrfs_ioctl_defrag(struct file *file, void __user *argp) 2179static int btrfs_ioctl_defrag(struct file *file, void __user *argp)
2180{ 2180{
2181 struct inode *inode = fdentry(file)->d_inode; 2181 struct inode *inode = file_inode(file);
2182 struct btrfs_root *root = BTRFS_I(inode)->root; 2182 struct btrfs_root *root = BTRFS_I(inode)->root;
2183 struct btrfs_ioctl_defrag_range_args *range; 2183 struct btrfs_ioctl_defrag_range_args *range;
2184 int ret; 2184 int ret;
@@ -2237,7 +2237,7 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp)
2237 /* the rest are all set to zero by kzalloc */ 2237 /* the rest are all set to zero by kzalloc */
2238 range->len = (u64)-1; 2238 range->len = (u64)-1;
2239 } 2239 }
2240 ret = btrfs_defrag_file(fdentry(file)->d_inode, file, 2240 ret = btrfs_defrag_file(file_inode(file), file,
2241 range, 0, 0); 2241 range, 0, 0);
2242 if (ret > 0) 2242 if (ret > 0)
2243 ret = 0; 2243 ret = 0;
@@ -2285,7 +2285,7 @@ out:
2285 2285
2286static long btrfs_ioctl_rm_dev(struct file *file, void __user *arg) 2286static long btrfs_ioctl_rm_dev(struct file *file, void __user *arg)
2287{ 2287{
2288 struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 2288 struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
2289 struct btrfs_ioctl_vol_args *vol_args; 2289 struct btrfs_ioctl_vol_args *vol_args;
2290 int ret; 2290 int ret;
2291 2291
@@ -2408,7 +2408,7 @@ out:
2408static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, 2408static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
2409 u64 off, u64 olen, u64 destoff) 2409 u64 off, u64 olen, u64 destoff)
2410{ 2410{
2411 struct inode *inode = fdentry(file)->d_inode; 2411 struct inode *inode = file_inode(file);
2412 struct btrfs_root *root = BTRFS_I(inode)->root; 2412 struct btrfs_root *root = BTRFS_I(inode)->root;
2413 struct fd src_file; 2413 struct fd src_file;
2414 struct inode *src; 2414 struct inode *src;
@@ -2454,7 +2454,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
2454 if (src_file.file->f_path.mnt != file->f_path.mnt) 2454 if (src_file.file->f_path.mnt != file->f_path.mnt)
2455 goto out_fput; 2455 goto out_fput;
2456 2456
2457 src = src_file.file->f_dentry->d_inode; 2457 src = file_inode(src_file.file);
2458 2458
2459 ret = -EINVAL; 2459 ret = -EINVAL;
2460 if (src == inode) 2460 if (src == inode)
@@ -2816,7 +2816,7 @@ static long btrfs_ioctl_clone_range(struct file *file, void __user *argp)
2816 */ 2816 */
2817static long btrfs_ioctl_trans_start(struct file *file) 2817static long btrfs_ioctl_trans_start(struct file *file)
2818{ 2818{
2819 struct inode *inode = fdentry(file)->d_inode; 2819 struct inode *inode = file_inode(file);
2820 struct btrfs_root *root = BTRFS_I(inode)->root; 2820 struct btrfs_root *root = BTRFS_I(inode)->root;
2821 struct btrfs_trans_handle *trans; 2821 struct btrfs_trans_handle *trans;
2822 int ret; 2822 int ret;
@@ -2856,7 +2856,7 @@ out:
2856 2856
2857static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp) 2857static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp)
2858{ 2858{
2859 struct inode *inode = fdentry(file)->d_inode; 2859 struct inode *inode = file_inode(file);
2860 struct btrfs_root *root = BTRFS_I(inode)->root; 2860 struct btrfs_root *root = BTRFS_I(inode)->root;
2861 struct btrfs_root *new_root; 2861 struct btrfs_root *new_root;
2862 struct btrfs_dir_item *di; 2862 struct btrfs_dir_item *di;
@@ -3080,7 +3080,7 @@ out:
3080 */ 3080 */
3081long btrfs_ioctl_trans_end(struct file *file) 3081long btrfs_ioctl_trans_end(struct file *file)
3082{ 3082{
3083 struct inode *inode = fdentry(file)->d_inode; 3083 struct inode *inode = file_inode(file);
3084 struct btrfs_root *root = BTRFS_I(inode)->root; 3084 struct btrfs_root *root = BTRFS_I(inode)->root;
3085 struct btrfs_trans_handle *trans; 3085 struct btrfs_trans_handle *trans;
3086 3086
@@ -3142,7 +3142,7 @@ static noinline long btrfs_ioctl_wait_sync(struct btrfs_root *root,
3142 3142
3143static long btrfs_ioctl_scrub(struct file *file, void __user *arg) 3143static long btrfs_ioctl_scrub(struct file *file, void __user *arg)
3144{ 3144{
3145 struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 3145 struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
3146 struct btrfs_ioctl_scrub_args *sa; 3146 struct btrfs_ioctl_scrub_args *sa;
3147 int ret; 3147 int ret;
3148 3148
@@ -3433,7 +3433,7 @@ void update_ioctl_balance_args(struct btrfs_fs_info *fs_info, int lock,
3433 3433
3434static long btrfs_ioctl_balance(struct file *file, void __user *arg) 3434static long btrfs_ioctl_balance(struct file *file, void __user *arg)
3435{ 3435{
3436 struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 3436 struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
3437 struct btrfs_fs_info *fs_info = root->fs_info; 3437 struct btrfs_fs_info *fs_info = root->fs_info;
3438 struct btrfs_ioctl_balance_args *bargs; 3438 struct btrfs_ioctl_balance_args *bargs;
3439 struct btrfs_balance_control *bctl; 3439 struct btrfs_balance_control *bctl;
@@ -3573,7 +3573,7 @@ out:
3573 3573
3574static long btrfs_ioctl_quota_ctl(struct file *file, void __user *arg) 3574static long btrfs_ioctl_quota_ctl(struct file *file, void __user *arg)
3575{ 3575{
3576 struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 3576 struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
3577 struct btrfs_ioctl_quota_ctl_args *sa; 3577 struct btrfs_ioctl_quota_ctl_args *sa;
3578 struct btrfs_trans_handle *trans = NULL; 3578 struct btrfs_trans_handle *trans = NULL;
3579 int ret; 3579 int ret;
@@ -3632,7 +3632,7 @@ drop_write:
3632 3632
3633static long btrfs_ioctl_qgroup_assign(struct file *file, void __user *arg) 3633static long btrfs_ioctl_qgroup_assign(struct file *file, void __user *arg)
3634{ 3634{
3635 struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 3635 struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
3636 struct btrfs_ioctl_qgroup_assign_args *sa; 3636 struct btrfs_ioctl_qgroup_assign_args *sa;
3637 struct btrfs_trans_handle *trans; 3637 struct btrfs_trans_handle *trans;
3638 int ret; 3638 int ret;
@@ -3679,7 +3679,7 @@ drop_write:
3679 3679
3680static long btrfs_ioctl_qgroup_create(struct file *file, void __user *arg) 3680static long btrfs_ioctl_qgroup_create(struct file *file, void __user *arg)
3681{ 3681{
3682 struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 3682 struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
3683 struct btrfs_ioctl_qgroup_create_args *sa; 3683 struct btrfs_ioctl_qgroup_create_args *sa;
3684 struct btrfs_trans_handle *trans; 3684 struct btrfs_trans_handle *trans;
3685 int ret; 3685 int ret;
@@ -3725,7 +3725,7 @@ drop_write:
3725 3725
3726static long btrfs_ioctl_qgroup_limit(struct file *file, void __user *arg) 3726static long btrfs_ioctl_qgroup_limit(struct file *file, void __user *arg)
3727{ 3727{
3728 struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 3728 struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
3729 struct btrfs_ioctl_qgroup_limit_args *sa; 3729 struct btrfs_ioctl_qgroup_limit_args *sa;
3730 struct btrfs_trans_handle *trans; 3730 struct btrfs_trans_handle *trans;
3731 int ret; 3731 int ret;
@@ -3775,7 +3775,7 @@ static long btrfs_ioctl_set_received_subvol(struct file *file,
3775 void __user *arg) 3775 void __user *arg)
3776{ 3776{
3777 struct btrfs_ioctl_received_subvol_args *sa = NULL; 3777 struct btrfs_ioctl_received_subvol_args *sa = NULL;
3778 struct inode *inode = fdentry(file)->d_inode; 3778 struct inode *inode = file_inode(file);
3779 struct btrfs_root *root = BTRFS_I(inode)->root; 3779 struct btrfs_root *root = BTRFS_I(inode)->root;
3780 struct btrfs_root_item *root_item = &root->root_item; 3780 struct btrfs_root_item *root_item = &root->root_item;
3781 struct btrfs_trans_handle *trans; 3781 struct btrfs_trans_handle *trans;
@@ -3855,7 +3855,7 @@ out:
3855long btrfs_ioctl(struct file *file, unsigned int 3855long btrfs_ioctl(struct file *file, unsigned int
3856 cmd, unsigned long arg) 3856 cmd, unsigned long arg)
3857{ 3857{
3858 struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 3858 struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
3859 void __user *argp = (void __user *)arg; 3859 void __user *argp = (void __user *)arg;
3860 3860
3861 switch (cmd) { 3861 switch (cmd) {