Commit 14f9f7b28e9f4c2102337d45f8d324c004a57481
Committed by
Linus Torvalds
1 parent
f762e9054f
Exists in
master
and in
39 other branches
BKL-removal: convert ext2 over to use unlocked_ioctl
I checked ext2_ioctl and could not find anything in there that would need the BKL. So convert it over to use unlocked_ioctl Signed-off-by: Andi Kleen <ak@suse.de> Cc: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 4 changed files with 7 additions and 14 deletions Side-by-side Diff
fs/ext2/dir.c
fs/ext2/ext2.h
... | ... | @@ -139,8 +139,7 @@ |
139 | 139 | struct page **pagep, void **fsdata); |
140 | 140 | |
141 | 141 | /* ioctl.c */ |
142 | -extern int ext2_ioctl (struct inode *, struct file *, unsigned int, | |
143 | - unsigned long); | |
142 | +extern long ext2_ioctl(struct file *, unsigned int, unsigned long); | |
144 | 143 | extern long ext2_compat_ioctl(struct file *, unsigned int, unsigned long); |
145 | 144 | |
146 | 145 | /* namei.c */ |
fs/ext2/file.c
... | ... | @@ -48,7 +48,7 @@ |
48 | 48 | .write = do_sync_write, |
49 | 49 | .aio_read = generic_file_aio_read, |
50 | 50 | .aio_write = generic_file_aio_write, |
51 | - .ioctl = ext2_ioctl, | |
51 | + .unlocked_ioctl = ext2_ioctl, | |
52 | 52 | #ifdef CONFIG_COMPAT |
53 | 53 | .compat_ioctl = ext2_compat_ioctl, |
54 | 54 | #endif |
... | ... | @@ -65,7 +65,7 @@ |
65 | 65 | .llseek = generic_file_llseek, |
66 | 66 | .read = xip_file_read, |
67 | 67 | .write = xip_file_write, |
68 | - .ioctl = ext2_ioctl, | |
68 | + .unlocked_ioctl = ext2_ioctl, | |
69 | 69 | #ifdef CONFIG_COMPAT |
70 | 70 | .compat_ioctl = ext2_compat_ioctl, |
71 | 71 | #endif |
fs/ext2/ioctl.c
... | ... | @@ -17,9 +17,9 @@ |
17 | 17 | #include <asm/uaccess.h> |
18 | 18 | |
19 | 19 | |
20 | -int ext2_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, | |
21 | - unsigned long arg) | |
20 | +long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |
22 | 21 | { |
22 | + struct inode *inode = filp->f_dentry->d_inode; | |
23 | 23 | struct ext2_inode_info *ei = EXT2_I(inode); |
24 | 24 | unsigned int flags; |
25 | 25 | unsigned short rsv_window_size; |
... | ... | @@ -141,9 +141,6 @@ |
141 | 141 | #ifdef CONFIG_COMPAT |
142 | 142 | long ext2_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
143 | 143 | { |
144 | - struct inode *inode = file->f_path.dentry->d_inode; | |
145 | - int ret; | |
146 | - | |
147 | 144 | /* These are just misnamed, they actually get/put from/to user an int */ |
148 | 145 | switch (cmd) { |
149 | 146 | case EXT2_IOC32_GETFLAGS: |
... | ... | @@ -161,10 +158,7 @@ |
161 | 158 | default: |
162 | 159 | return -ENOIOCTLCMD; |
163 | 160 | } |
164 | - lock_kernel(); | |
165 | - ret = ext2_ioctl(inode, file, cmd, (unsigned long) compat_ptr(arg)); | |
166 | - unlock_kernel(); | |
167 | - return ret; | |
161 | + return ext2_ioctl(file, cmd, (unsigned long) compat_ptr(arg)); | |
168 | 162 | } |
169 | 163 | #endif |