aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2007-09-14 10:22:47 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-09-14 10:22:47 -0400
commit34287aa3605d52ef5a4b6e5e2cca98667166508b (patch)
tree9fe98c52d32c2bfe0ee37115b7bafa1dae7f320d /fs/btrfs/inode.c
parent432eba0882a32d6181ba44044f6e576226134784 (diff)
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:
1957 return 0; 1957 return 0;
1958} 1958}
1959 1959
1960int btrfs_ioctl(struct inode *inode, struct file *filp, unsigned int 1960long btrfs_ioctl(struct file *file, unsigned int
1961 cmd, unsigned long arg) 1961 cmd, unsigned long arg)
1962{ 1962{
1963 struct inode *inode = file->f_path.dentry->d_inode;
1963 struct btrfs_root *root = BTRFS_I(inode)->root; 1964 struct btrfs_root *root = BTRFS_I(inode)->root;
1964 struct btrfs_ioctl_vol_args vol_args; 1965 struct btrfs_ioctl_vol_args vol_args;
1965 int ret = 0; 1966 int ret = 0;
@@ -2007,7 +2008,7 @@ int btrfs_ioctl(struct inode *inode, struct file *filp, unsigned int
2007 btrfs_defrag_root(root->fs_info->extent_root, 0); 2008 btrfs_defrag_root(root->fs_info->extent_root, 0);
2008 mutex_unlock(&root->fs_info->fs_mutex); 2009 mutex_unlock(&root->fs_info->fs_mutex);
2009 } else if (S_ISREG(inode->i_mode)) { 2010 } else if (S_ISREG(inode->i_mode)) {
2010 btrfs_defrag_file(filp); 2011 btrfs_defrag_file(file);
2011 } 2012 }
2012 ret = 0; 2013 ret = 0;
2013 break; 2014 break;
@@ -2017,20 +2018,6 @@ int btrfs_ioctl(struct inode *inode, struct file *filp, unsigned int
2017 return ret; 2018 return ret;
2018} 2019}
2019 2020
2020#ifdef CONFIG_COMPAT
2021long btrfs_compat_ioctl(struct file *file, unsigned int cmd,
2022 unsigned long arg)
2023{
2024 struct inode *inode = file->f_path.dentry->d_inode;
2025 int ret;
2026 lock_kernel();
2027 ret = btrfs_ioctl(inode, file, cmd, (unsigned long) compat_ptr(arg));
2028 unlock_kernel();
2029 return ret;
2030
2031}
2032#endif
2033
2034/* 2021/*
2035 * Called inside transaction, so use GFP_NOFS 2022 * Called inside transaction, so use GFP_NOFS
2036 */ 2023 */
@@ -2341,9 +2328,9 @@ static struct file_operations btrfs_dir_file_operations = {
2341 .llseek = generic_file_llseek, 2328 .llseek = generic_file_llseek,
2342 .read = generic_read_dir, 2329 .read = generic_read_dir,
2343 .readdir = btrfs_readdir, 2330 .readdir = btrfs_readdir,
2344 .ioctl = btrfs_ioctl, 2331 .unlocked_ioctl = btrfs_ioctl,
2345#ifdef CONFIG_COMPAT 2332#ifdef CONFIG_COMPAT
2346 .compat_ioctl = btrfs_compat_ioctl, 2333 .compat_ioctl = btrfs_ioctl,
2347#endif 2334#endif
2348}; 2335};
2349 2336