diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-24 11:01:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-24 11:01:10 -0400 |
commit | f13771187b9423b824f32518319f6da85d819003 (patch) | |
tree | c431cf16c286065a302d5f3fb43fc1abac7e4047 /fs/autofs4/root.c | |
parent | 15953654cc312429740fd58fb37a5a3d63a54376 (diff) | |
parent | 9f37af654fda88a8dcca74c785f6c20e52758866 (diff) |
Merge branch 'bkl/ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing
* 'bkl/ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing:
uml: Pushdown the bkl from harddog_kern ioctl
sunrpc: Pushdown the bkl from sunrpc cache ioctl
sunrpc: Pushdown the bkl from ioctl
autofs4: Pushdown the bkl from ioctl
uml: Convert to unlocked_ioctls to remove implicit BKL
ncpfs: BKL ioctl pushdown
coda: Clean-up whitespace problems in pioctl.c
coda: BKL ioctl pushdown
drivers: Push down BKL into various drivers
isdn: Push down BKL into ioctl functions
scsi: Push down BKL into ioctl functions
dvb: Push down BKL into ioctl functions
smbfs: Push down BKL into ioctl function
coda/psdev: Remove BKL from ioctl function
um/mmapper: Remove BKL usage
sn_hwperf: Kill BKL usage
hfsplus: Push down BKL into ioctl function
Diffstat (limited to 'fs/autofs4/root.c')
-rw-r--r-- | fs/autofs4/root.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index e8e5e63ac950..db4117ed7803 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c | |||
@@ -18,13 +18,14 @@ | |||
18 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
19 | #include <linux/param.h> | 19 | #include <linux/param.h> |
20 | #include <linux/time.h> | 20 | #include <linux/time.h> |
21 | #include <linux/smp_lock.h> | ||
21 | #include "autofs_i.h" | 22 | #include "autofs_i.h" |
22 | 23 | ||
23 | static int autofs4_dir_symlink(struct inode *,struct dentry *,const char *); | 24 | static int autofs4_dir_symlink(struct inode *,struct dentry *,const char *); |
24 | static int autofs4_dir_unlink(struct inode *,struct dentry *); | 25 | static int autofs4_dir_unlink(struct inode *,struct dentry *); |
25 | static int autofs4_dir_rmdir(struct inode *,struct dentry *); | 26 | static int autofs4_dir_rmdir(struct inode *,struct dentry *); |
26 | static int autofs4_dir_mkdir(struct inode *,struct dentry *,int); | 27 | static int autofs4_dir_mkdir(struct inode *,struct dentry *,int); |
27 | static int autofs4_root_ioctl(struct inode *, struct file *,unsigned int,unsigned long); | 28 | static long autofs4_root_ioctl(struct file *,unsigned int,unsigned long); |
28 | static int autofs4_dir_open(struct inode *inode, struct file *file); | 29 | static int autofs4_dir_open(struct inode *inode, struct file *file); |
29 | static struct dentry *autofs4_lookup(struct inode *,struct dentry *, struct nameidata *); | 30 | static struct dentry *autofs4_lookup(struct inode *,struct dentry *, struct nameidata *); |
30 | static void *autofs4_follow_link(struct dentry *, struct nameidata *); | 31 | static void *autofs4_follow_link(struct dentry *, struct nameidata *); |
@@ -38,7 +39,7 @@ const struct file_operations autofs4_root_operations = { | |||
38 | .read = generic_read_dir, | 39 | .read = generic_read_dir, |
39 | .readdir = dcache_readdir, | 40 | .readdir = dcache_readdir, |
40 | .llseek = dcache_dir_lseek, | 41 | .llseek = dcache_dir_lseek, |
41 | .ioctl = autofs4_root_ioctl, | 42 | .unlocked_ioctl = autofs4_root_ioctl, |
42 | }; | 43 | }; |
43 | 44 | ||
44 | const struct file_operations autofs4_dir_operations = { | 45 | const struct file_operations autofs4_dir_operations = { |
@@ -902,8 +903,8 @@ int is_autofs4_dentry(struct dentry *dentry) | |||
902 | * ioctl()'s on the root directory is the chief method for the daemon to | 903 | * ioctl()'s on the root directory is the chief method for the daemon to |
903 | * generate kernel reactions | 904 | * generate kernel reactions |
904 | */ | 905 | */ |
905 | static int autofs4_root_ioctl(struct inode *inode, struct file *filp, | 906 | static int autofs4_root_ioctl_unlocked(struct inode *inode, struct file *filp, |
906 | unsigned int cmd, unsigned long arg) | 907 | unsigned int cmd, unsigned long arg) |
907 | { | 908 | { |
908 | struct autofs_sb_info *sbi = autofs4_sbi(inode->i_sb); | 909 | struct autofs_sb_info *sbi = autofs4_sbi(inode->i_sb); |
909 | void __user *p = (void __user *)arg; | 910 | void __user *p = (void __user *)arg; |
@@ -947,3 +948,16 @@ static int autofs4_root_ioctl(struct inode *inode, struct file *filp, | |||
947 | return -ENOSYS; | 948 | return -ENOSYS; |
948 | } | 949 | } |
949 | } | 950 | } |
951 | |||
952 | static long autofs4_root_ioctl(struct file *filp, | ||
953 | unsigned int cmd, unsigned long arg) | ||
954 | { | ||
955 | long ret; | ||
956 | struct inode *inode = filp->f_dentry->d_inode; | ||
957 | |||
958 | lock_kernel(); | ||
959 | ret = autofs4_root_ioctl_unlocked(inode, filp, cmd, arg); | ||
960 | unlock_kernel(); | ||
961 | |||
962 | return ret; | ||
963 | } | ||