diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-22 10:52:01 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-22 10:52:01 -0700 |
commit | 79f14b7c56d3b3ba58f8b43d1f70b9b71477a800 (patch) | |
tree | 3bb53b7806c1baba6cc24b91724a9264cceccd39 /fs/autofs4/root.c | |
parent | c37927d4359e81b85de644f8fb08878717cf5f3f (diff) | |
parent | 6d7bccc2215c37205ede6c9cf84db64e7c4f9443 (diff) |
Merge branch 'vfs' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl
* 'vfs' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl: (30 commits)
BKL: remove BKL from freevxfs
BKL: remove BKL from qnx4
autofs4: Only declare function when CONFIG_COMPAT is defined
autofs: Only declare function when CONFIG_COMPAT is defined
ncpfs: Lock socket in ncpfs while setting its callbacks
fs/locks.c: prepare for BKL removal
BKL: Remove BKL from ncpfs
BKL: Remove BKL from OCFS2
BKL: Remove BKL from squashfs
BKL: Remove BKL from jffs2
BKL: Remove BKL from ecryptfs
BKL: Remove BKL from afs
BKL: Remove BKL from USB gadgetfs
BKL: Remove BKL from autofs4
BKL: Remove BKL from isofs
BKL: Remove BKL from fat
BKL: Remove BKL from ext2 filesystem
BKL: Remove BKL from do_new_mount()
BKL: Remove BKL from cgroup
BKL: Remove BKL from NTFS
...
Diffstat (limited to 'fs/autofs4/root.c')
-rw-r--r-- | fs/autofs4/root.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index cb1bd38dc08..d5c1401f003 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c @@ -19,7 +19,7 @@ #include <linux/param.h> #include <linux/time.h> #include <linux/compat.h> -#include <linux/smp_lock.h> +#include <linux/mutex.h> #include "autofs_i.h" @@ -28,7 +28,9 @@ static int autofs4_dir_unlink(struct inode *,struct dentry *); static int autofs4_dir_rmdir(struct inode *,struct dentry *); static int autofs4_dir_mkdir(struct inode *,struct dentry *,int); static long autofs4_root_ioctl(struct file *,unsigned int,unsigned long); +#ifdef CONFIG_COMPAT static long autofs4_root_compat_ioctl(struct file *,unsigned int,unsigned long); +#endif static int autofs4_dir_open(struct inode *inode, struct file *file); static struct dentry *autofs4_lookup(struct inode *,struct dentry *, struct nameidata *); static void *autofs4_follow_link(struct dentry *, struct nameidata *); @@ -978,15 +980,17 @@ static int autofs4_root_ioctl_unlocked(struct inode *inode, struct file *filp, } } +static DEFINE_MUTEX(autofs4_ioctl_mutex); + static long autofs4_root_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { long ret; struct inode *inode = filp->f_dentry->d_inode; - lock_kernel(); + mutex_lock(&autofs4_ioctl_mutex); ret = autofs4_root_ioctl_unlocked(inode, filp, cmd, arg); - unlock_kernel(); + mutex_unlock(&autofs4_ioctl_mutex); return ret; } @@ -998,13 +1002,13 @@ static long autofs4_root_compat_ioctl(struct file *filp, struct inode *inode = filp->f_path.dentry->d_inode; int ret; - lock_kernel(); + mutex_lock(&autofs4_ioctl_mutex); if (cmd == AUTOFS_IOC_READY || cmd == AUTOFS_IOC_FAIL) ret = autofs4_root_ioctl_unlocked(inode, filp, cmd, arg); else ret = autofs4_root_ioctl_unlocked(inode, filp, cmd, (unsigned long)compat_ptr(arg)); - unlock_kernel(); + mutex_unlock(&autofs4_ioctl_mutex); return ret; } |