summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorChristoph Hellwig2007-09-14 16:22:47 +0200
committerDavid Woodhouse2007-09-14 16:22:47 +0200
commit34287aa3605d52ef5a4b6e5e2cca98667166508b (patch)
tree9fe98c52d32c2bfe0ee37115b7bafa1dae7f320d /fs/btrfs/inode.c
parentBtrfs: Simplify makefile (diff)
downloadkernel-qcow2-linux-34287aa3605d52ef5a4b6e5e2cca98667166508b.tar.gz
kernel-qcow2-linux-34287aa3605d52ef5a4b6e5e2cca98667166508b.tar.xz
kernel-qcow2-linux-34287aa3605d52ef5a4b6e5e2cca98667166508b.zip
Btrfs: use unlocked_ioctl
No reason to grab the BKL before calling into the btrfs ioctl code. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index cde8ddde6098..3901a7fa0947 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1957,9 +1957,10 @@ out_unlock:
return 0;
}
-int btrfs_ioctl(struct inode *inode, struct file *filp, unsigned int
+long btrfs_ioctl(struct file *file, unsigned int
cmd, unsigned long arg)
{
+ struct inode *inode = file->f_path.dentry->d_inode;
struct btrfs_root *root = BTRFS_I(inode)->root;
struct btrfs_ioctl_vol_args vol_args;
int ret = 0;
@@ -2007,7 +2008,7 @@ int btrfs_ioctl(struct inode *inode, struct file *filp, unsigned int
btrfs_defrag_root(root->fs_info->extent_root, 0);
mutex_unlock(&root->fs_info->fs_mutex);
} else if (S_ISREG(inode->i_mode)) {
- btrfs_defrag_file(filp);
+ btrfs_defrag_file(file);
}
ret = 0;
break;
@@ -2017,20 +2018,6 @@ int btrfs_ioctl(struct inode *inode, struct file *filp, unsigned int
return ret;
}
-#ifdef CONFIG_COMPAT
-long btrfs_compat_ioctl(struct file *file, unsigned int cmd,
- unsigned long arg)
-{
- struct inode *inode = file->f_path.dentry->d_inode;
- int ret;
- lock_kernel();
- ret = btrfs_ioctl(inode, file, cmd, (unsigned long) compat_ptr(arg));
- unlock_kernel();
- return ret;
-
-}
-#endif
-
/*
* Called inside transaction, so use GFP_NOFS
*/
@@ -2341,9 +2328,9 @@ static struct file_operations btrfs_dir_file_operations = {
.llseek = generic_file_llseek,
.read = generic_read_dir,
.readdir = btrfs_readdir,
- .ioctl = btrfs_ioctl,
+ .unlocked_ioctl = btrfs_ioctl,
#ifdef CONFIG_COMPAT
- .compat_ioctl = btrfs_compat_ioctl,
+ .compat_ioctl = btrfs_ioctl,
#endif
};