Commit 6de43703108bb1d3fc9495b3e8107d6ec72f97e4

Authored by Arnd Bergmann
Committed by Jens Axboe
1 parent 62c2a7d969

block: remove BKL from BLKROSET and BLKFLSBUF

We only call the functions set_device_ro(),
invalidate_bdev(), sync_filesystem() and sync_blockdev()
while holding the BKL in these commands. All
of these are also done in other code paths without
the BKL, which leads me to the conclusion that
the BKL is not needed here either.

The reason we hold it here is that it was originally
pushed down into the ioctl function from vfs_ioctl.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>

Showing 1 changed file with 0 additions and 4 deletions Side-by-side Diff

... ... @@ -197,10 +197,8 @@
197 197 if (ret != -EINVAL && ret != -ENOTTY)
198 198 return ret;
199 199  
200   - lock_kernel();
201 200 fsync_bdev(bdev);
202 201 invalidate_bdev(bdev);
203   - unlock_kernel();
204 202 return 0;
205 203  
206 204 case BLKROSET:
207 205  
... ... @@ -212,9 +210,7 @@
212 210 return -EACCES;
213 211 if (get_user(n, (int __user *)(arg)))
214 212 return -EFAULT;
215   - lock_kernel();
216 213 set_device_ro(bdev, n);
217   - unlock_kernel();
218 214 return 0;
219 215  
220 216 case BLKDISCARD: {