diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-13 20:52:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-13 20:52:35 -0400 |
commit | 10041d2d14688e207d0d829095147aa82c1f211b (patch) | |
tree | 57ef361d05e6bbffe3ec490ca9110878a6e969e2 /fs/proc/inode.c | |
parent | 4914c7f881845367b9198631a014ab466329b9e5 (diff) | |
parent | b19dd42faf413b4705d4adb38521e82d73fa4249 (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:
bkl: Remove locked .ioctl file operation
v4l: Remove reference to bkl ioctl in compat ioctl handling
logfs: kill BKL
Diffstat (limited to 'fs/proc/inode.c')
-rw-r--r-- | fs/proc/inode.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 23561cda7245..9c2b5f484879 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c | |||
@@ -214,8 +214,7 @@ static long proc_reg_unlocked_ioctl(struct file *file, unsigned int cmd, unsigne | |||
214 | { | 214 | { |
215 | struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); | 215 | struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); |
216 | long rv = -ENOTTY; | 216 | long rv = -ENOTTY; |
217 | long (*unlocked_ioctl)(struct file *, unsigned int, unsigned long); | 217 | long (*ioctl)(struct file *, unsigned int, unsigned long); |
218 | int (*ioctl)(struct inode *, struct file *, unsigned int, unsigned long); | ||
219 | 218 | ||
220 | spin_lock(&pde->pde_unload_lock); | 219 | spin_lock(&pde->pde_unload_lock); |
221 | if (!pde->proc_fops) { | 220 | if (!pde->proc_fops) { |
@@ -223,19 +222,11 @@ static long proc_reg_unlocked_ioctl(struct file *file, unsigned int cmd, unsigne | |||
223 | return rv; | 222 | return rv; |
224 | } | 223 | } |
225 | pde->pde_users++; | 224 | pde->pde_users++; |
226 | unlocked_ioctl = pde->proc_fops->unlocked_ioctl; | 225 | ioctl = pde->proc_fops->unlocked_ioctl; |
227 | ioctl = pde->proc_fops->ioctl; | ||
228 | spin_unlock(&pde->pde_unload_lock); | 226 | spin_unlock(&pde->pde_unload_lock); |
229 | 227 | ||
230 | if (unlocked_ioctl) { | 228 | if (ioctl) |
231 | rv = unlocked_ioctl(file, cmd, arg); | 229 | rv = ioctl(file, cmd, arg); |
232 | if (rv == -ENOIOCTLCMD) | ||
233 | rv = -EINVAL; | ||
234 | } else if (ioctl) { | ||
235 | WARN_ONCE(1, "Procfs ioctl handlers must use unlocked_ioctl, " | ||
236 | "%pf will be called without the Bkl held\n", ioctl); | ||
237 | rv = ioctl(file->f_path.dentry->d_inode, file, cmd, arg); | ||
238 | } | ||
239 | 230 | ||
240 | pde_users_dec(pde); | 231 | pde_users_dec(pde); |
241 | return rv; | 232 | return rv; |