diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-22 13:52:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-22 13:52:01 -0400 |
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 cb1bd38dc08c..d5c1401f0031 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c | |||
@@ -19,7 +19,7 @@ | |||
19 | #include <linux/param.h> | 19 | #include <linux/param.h> |
20 | #include <linux/time.h> | 20 | #include <linux/time.h> |
21 | #include <linux/compat.h> | 21 | #include <linux/compat.h> |
22 | #include <linux/smp_lock.h> | 22 | #include <linux/mutex.h> |
23 | 23 | ||
24 | #include "autofs_i.h" | 24 | #include "autofs_i.h" |
25 | 25 | ||
@@ -28,7 +28,9 @@ static int autofs4_dir_unlink(struct inode *,struct dentry *); | |||
28 | static int autofs4_dir_rmdir(struct inode *,struct dentry *); | 28 | static int autofs4_dir_rmdir(struct inode *,struct dentry *); |
29 | static int autofs4_dir_mkdir(struct inode *,struct dentry *,int); | 29 | static int autofs4_dir_mkdir(struct inode *,struct dentry *,int); |
30 | static long autofs4_root_ioctl(struct file *,unsigned int,unsigned long); | 30 | static long autofs4_root_ioctl(struct file *,unsigned int,unsigned long); |
31 | #ifdef CONFIG_COMPAT | ||
31 | static long autofs4_root_compat_ioctl(struct file *,unsigned int,unsigned long); | 32 | static long autofs4_root_compat_ioctl(struct file *,unsigned int,unsigned long); |
33 | #endif | ||
32 | static int autofs4_dir_open(struct inode *inode, struct file *file); | 34 | static int autofs4_dir_open(struct inode *inode, struct file *file); |
33 | static struct dentry *autofs4_lookup(struct inode *,struct dentry *, struct nameidata *); | 35 | static struct dentry *autofs4_lookup(struct inode *,struct dentry *, struct nameidata *); |
34 | static void *autofs4_follow_link(struct dentry *, struct nameidata *); | 36 | 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, | |||
978 | } | 980 | } |
979 | } | 981 | } |
980 | 982 | ||
983 | static DEFINE_MUTEX(autofs4_ioctl_mutex); | ||
984 | |||
981 | static long autofs4_root_ioctl(struct file *filp, | 985 | static long autofs4_root_ioctl(struct file *filp, |
982 | unsigned int cmd, unsigned long arg) | 986 | unsigned int cmd, unsigned long arg) |
983 | { | 987 | { |
984 | long ret; | 988 | long ret; |
985 | struct inode *inode = filp->f_dentry->d_inode; | 989 | struct inode *inode = filp->f_dentry->d_inode; |
986 | 990 | ||
987 | lock_kernel(); | 991 | mutex_lock(&autofs4_ioctl_mutex); |
988 | ret = autofs4_root_ioctl_unlocked(inode, filp, cmd, arg); | 992 | ret = autofs4_root_ioctl_unlocked(inode, filp, cmd, arg); |
989 | unlock_kernel(); | 993 | mutex_unlock(&autofs4_ioctl_mutex); |
990 | 994 | ||
991 | return ret; | 995 | return ret; |
992 | } | 996 | } |
@@ -998,13 +1002,13 @@ static long autofs4_root_compat_ioctl(struct file *filp, | |||
998 | struct inode *inode = filp->f_path.dentry->d_inode; | 1002 | struct inode *inode = filp->f_path.dentry->d_inode; |
999 | int ret; | 1003 | int ret; |
1000 | 1004 | ||
1001 | lock_kernel(); | 1005 | mutex_lock(&autofs4_ioctl_mutex); |
1002 | if (cmd == AUTOFS_IOC_READY || cmd == AUTOFS_IOC_FAIL) | 1006 | if (cmd == AUTOFS_IOC_READY || cmd == AUTOFS_IOC_FAIL) |
1003 | ret = autofs4_root_ioctl_unlocked(inode, filp, cmd, arg); | 1007 | ret = autofs4_root_ioctl_unlocked(inode, filp, cmd, arg); |
1004 | else | 1008 | else |
1005 | ret = autofs4_root_ioctl_unlocked(inode, filp, cmd, | 1009 | ret = autofs4_root_ioctl_unlocked(inode, filp, cmd, |
1006 | (unsigned long)compat_ptr(arg)); | 1010 | (unsigned long)compat_ptr(arg)); |
1007 | unlock_kernel(); | 1011 | mutex_unlock(&autofs4_ioctl_mutex); |
1008 | 1012 | ||
1009 | return ret; | 1013 | return ret; |
1010 | } | 1014 | } |