]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - fs/btrfs/ioctl.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux...
[linux.git] / fs / btrfs / ioctl.c
index 898c5729e7e5300ba7c069ef175a21880a163347..2c02310ff2d96320ebf2d348ed339dd0ea047e0f 100644 (file)
@@ -152,7 +152,7 @@ void btrfs_inherit_iflags(struct inode *inode, struct inode *dir)
 
 static int btrfs_ioctl_getflags(struct file *file, void __user *arg)
 {
-       struct btrfs_inode *ip = BTRFS_I(file->f_path.dentry->d_inode);
+       struct btrfs_inode *ip = BTRFS_I(file_inode(file));
        unsigned int flags = btrfs_flags_to_ioctl(ip->flags);
 
        if (copy_to_user(arg, &flags, sizeof(flags)))
@@ -177,7 +177,7 @@ static int check_flags(unsigned int flags)
 
 static int btrfs_ioctl_setflags(struct file *file, void __user *arg)
 {
-       struct inode *inode = file->f_path.dentry->d_inode;
+       struct inode *inode = file_inode(file);
        struct btrfs_inode *ip = BTRFS_I(inode);
        struct btrfs_root *root = ip->root;
        struct btrfs_trans_handle *trans;
@@ -310,7 +310,7 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg)
 
 static int btrfs_ioctl_getversion(struct file *file, int __user *arg)
 {
-       struct inode *inode = file->f_path.dentry->d_inode;
+       struct inode *inode = file_inode(file);
 
        return put_user(inode->i_generation, arg);
 }
@@ -1348,7 +1348,7 @@ static noinline int btrfs_ioctl_resize(struct file *file,
        u64 new_size;
        u64 old_size;
        u64 devid = 1;
-       struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root;
+       struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
        struct btrfs_ioctl_vol_args *vol_args;
        struct btrfs_trans_handle *trans;
        struct btrfs_device *device = NULL;
@@ -1518,8 +1518,8 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file,
                        goto out_drop_write;
                }
 
-               src_inode = src.file->f_path.dentry->d_inode;
-               if (src_inode->i_sb != file->f_path.dentry->d_inode->i_sb) {
+               src_inode = file_inode(src.file);
+               if (src_inode->i_sb != file_inode(file)->i_sb) {
                        printk(KERN_INFO "btrfs: Snapshot src from "
                               "another FS\n");
                        ret = -EINVAL;
@@ -1611,7 +1611,7 @@ static noinline int btrfs_ioctl_snap_create_v2(struct file *file,
 static noinline int btrfs_ioctl_subvol_getflags(struct file *file,
                                                void __user *arg)
 {
-       struct inode *inode = fdentry(file)->d_inode;
+       struct inode *inode = file_inode(file);
        struct btrfs_root *root = BTRFS_I(inode)->root;
        int ret = 0;
        u64 flags = 0;
@@ -1633,7 +1633,7 @@ static noinline int btrfs_ioctl_subvol_getflags(struct file *file,
 static noinline int btrfs_ioctl_subvol_setflags(struct file *file,
                                              void __user *arg)
 {
-       struct inode *inode = fdentry(file)->d_inode;
+       struct inode *inode = file_inode(file);
        struct btrfs_root *root = BTRFS_I(inode)->root;
        struct btrfs_trans_handle *trans;
        u64 root_flags;
@@ -1927,7 +1927,7 @@ static noinline int btrfs_ioctl_tree_search(struct file *file,
        if (IS_ERR(args))
                return PTR_ERR(args);
 
-       inode = fdentry(file)->d_inode;
+       inode = file_inode(file);
        ret = search_ioctl(inode, args);
        if (ret == 0 && copy_to_user(argp, args, sizeof(*args)))
                ret = -EFAULT;
@@ -2037,7 +2037,7 @@ static noinline int btrfs_ioctl_ino_lookup(struct file *file,
        if (IS_ERR(args))
                return PTR_ERR(args);
 
-       inode = fdentry(file)->d_inode;
+       inode = file_inode(file);
 
        if (args->treeid == 0)
                args->treeid = BTRFS_I(inode)->root->root_key.objectid;
@@ -2236,7 +2236,7 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file,
 
 static int btrfs_ioctl_defrag(struct file *file, void __user *argp)
 {
-       struct inode *inode = fdentry(file)->d_inode;
+       struct inode *inode = file_inode(file);
        struct btrfs_root *root = BTRFS_I(inode)->root;
        struct btrfs_ioctl_defrag_range_args *range;
        int ret;
@@ -2289,7 +2289,7 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp)
                        /* the rest are all set to zero by kzalloc */
                        range->len = (u64)-1;
                }
-               ret = btrfs_defrag_file(fdentry(file)->d_inode, file,
+               ret = btrfs_defrag_file(file_inode(file), file,
                                        range, 0, 0);
                if (ret > 0)
                        ret = 0;
@@ -2336,7 +2336,7 @@ static long btrfs_ioctl_add_dev(struct btrfs_root *root, void __user *arg)
 
 static long btrfs_ioctl_rm_dev(struct file *file, void __user *arg)
 {
-       struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root;
+       struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
        struct btrfs_ioctl_vol_args *vol_args;
        int ret;
 
@@ -2459,7 +2459,7 @@ static long btrfs_ioctl_dev_info(struct btrfs_root *root, void __user *arg)
 static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
                                       u64 off, u64 olen, u64 destoff)
 {
-       struct inode *inode = fdentry(file)->d_inode;
+       struct inode *inode = file_inode(file);
        struct btrfs_root *root = BTRFS_I(inode)->root;
        struct fd src_file;
        struct inode *src;
@@ -2505,7 +2505,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
        if (src_file.file->f_path.mnt != file->f_path.mnt)
                goto out_fput;
 
-       src = src_file.file->f_dentry->d_inode;
+       src = file_inode(src_file.file);
 
        ret = -EINVAL;
        if (src == inode)
@@ -2867,7 +2867,7 @@ static long btrfs_ioctl_clone_range(struct file *file, void __user *argp)
  */
 static long btrfs_ioctl_trans_start(struct file *file)
 {
-       struct inode *inode = fdentry(file)->d_inode;
+       struct inode *inode = file_inode(file);
        struct btrfs_root *root = BTRFS_I(inode)->root;
        struct btrfs_trans_handle *trans;
        int ret;
@@ -2907,7 +2907,7 @@ static long btrfs_ioctl_trans_start(struct file *file)
 
 static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp)
 {
-       struct inode *inode = fdentry(file)->d_inode;
+       struct inode *inode = file_inode(file);
        struct btrfs_root *root = BTRFS_I(inode)->root;
        struct btrfs_root *new_root;
        struct btrfs_dir_item *di;
@@ -3131,7 +3131,7 @@ long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg)
  */
 long btrfs_ioctl_trans_end(struct file *file)
 {
-       struct inode *inode = fdentry(file)->d_inode;
+       struct inode *inode = file_inode(file);
        struct btrfs_root *root = BTRFS_I(inode)->root;
        struct btrfs_trans_handle *trans;
 
@@ -3193,7 +3193,7 @@ static noinline long btrfs_ioctl_wait_sync(struct btrfs_root *root,
 
 static long btrfs_ioctl_scrub(struct file *file, void __user *arg)
 {
-       struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root;
+       struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
        struct btrfs_ioctl_scrub_args *sa;
        int ret;
 
@@ -3484,7 +3484,7 @@ void update_ioctl_balance_args(struct btrfs_fs_info *fs_info, int lock,
 
 static long btrfs_ioctl_balance(struct file *file, void __user *arg)
 {
-       struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root;
+       struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
        struct btrfs_fs_info *fs_info = root->fs_info;
        struct btrfs_ioctl_balance_args *bargs;
        struct btrfs_balance_control *bctl;
@@ -3674,7 +3674,7 @@ static long btrfs_ioctl_balance_progress(struct btrfs_root *root,
 
 static long btrfs_ioctl_quota_ctl(struct file *file, void __user *arg)
 {
-       struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root;
+       struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
        struct btrfs_ioctl_quota_ctl_args *sa;
        struct btrfs_trans_handle *trans = NULL;
        int ret;
@@ -3733,7 +3733,7 @@ static long btrfs_ioctl_quota_ctl(struct file *file, void __user *arg)
 
 static long btrfs_ioctl_qgroup_assign(struct file *file, void __user *arg)
 {
-       struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root;
+       struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
        struct btrfs_ioctl_qgroup_assign_args *sa;
        struct btrfs_trans_handle *trans;
        int ret;
@@ -3780,7 +3780,7 @@ static long btrfs_ioctl_qgroup_assign(struct file *file, void __user *arg)
 
 static long btrfs_ioctl_qgroup_create(struct file *file, void __user *arg)
 {
-       struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root;
+       struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
        struct btrfs_ioctl_qgroup_create_args *sa;
        struct btrfs_trans_handle *trans;
        int ret;
@@ -3831,7 +3831,7 @@ static long btrfs_ioctl_qgroup_create(struct file *file, void __user *arg)
 
 static long btrfs_ioctl_qgroup_limit(struct file *file, void __user *arg)
 {
-       struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root;
+       struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
        struct btrfs_ioctl_qgroup_limit_args *sa;
        struct btrfs_trans_handle *trans;
        int ret;
@@ -3881,7 +3881,7 @@ static long btrfs_ioctl_set_received_subvol(struct file *file,
                                            void __user *arg)
 {
        struct btrfs_ioctl_received_subvol_args *sa = NULL;
-       struct inode *inode = fdentry(file)->d_inode;
+       struct inode *inode = file_inode(file);
        struct btrfs_root *root = BTRFS_I(inode)->root;
        struct btrfs_root_item *root_item = &root->root_item;
        struct btrfs_trans_handle *trans;
@@ -4020,7 +4020,7 @@ static int btrfs_ioctl_set_fslabel(struct file *file, void __user *arg)
 long btrfs_ioctl(struct file *file, unsigned int
                cmd, unsigned long arg)
 {
-       struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root;
+       struct btrfs_root *root = BTRFS_I(file_inode(file))->root;
        void __user *argp = (void __user *)arg;
 
        switch (cmd) {