Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hfsplus: Push down BKL into ioctl function

HFS is one of the remaining users of the ->ioctl function, convert it
blindly to unlocked_ioctl by pushing down the BKL.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>

authored by

Arnd Bergmann and committed by
Frederic Weisbecker
7cc4bcc6 e40152ee

+12 -7
+1 -1
fs/hfsplus/dir.c
··· 494 494 const struct file_operations hfsplus_dir_operations = { 495 495 .read = generic_read_dir, 496 496 .readdir = hfsplus_readdir, 497 - .ioctl = hfsplus_ioctl, 497 + .unlocked_ioctl = hfsplus_ioctl, 498 498 .llseek = generic_file_llseek, 499 499 .release = hfsplus_dir_release, 500 500 };
+1 -2
fs/hfsplus/hfsplus_fs.h
··· 337 337 void hfsplus_delete_inode(struct inode *); 338 338 339 339 /* ioctl.c */ 340 - int hfsplus_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, 341 - unsigned long arg); 340 + long hfsplus_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); 342 341 int hfsplus_setxattr(struct dentry *dentry, const char *name, 343 342 const void *value, size_t size, int flags); 344 343 ssize_t hfsplus_getxattr(struct dentry *dentry, const char *name,
+1 -1
fs/hfsplus/inode.c
··· 285 285 .fsync = file_fsync, 286 286 .open = hfsplus_file_open, 287 287 .release = hfsplus_file_release, 288 - .ioctl = hfsplus_ioctl, 288 + .unlocked_ioctl = hfsplus_ioctl, 289 289 }; 290 290 291 291 struct inode *hfsplus_new_inode(struct super_block *sb, int mode)
+9 -3
fs/hfsplus/ioctl.c
··· 17 17 #include <linux/mount.h> 18 18 #include <linux/sched.h> 19 19 #include <linux/xattr.h> 20 + #include <linux/smp_lock.h> 20 21 #include <asm/uaccess.h> 21 22 #include "hfsplus_fs.h" 22 23 23 - int hfsplus_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, 24 - unsigned long arg) 24 + long hfsplus_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 25 25 { 26 + struct inode *inode = filp->f_path.dentry->d_inode; 26 27 unsigned int flags; 27 28 29 + lock_kernel(); 28 30 switch (cmd) { 29 31 case HFSPLUS_IOC_EXT2_GETFLAGS: 30 32 flags = 0; ··· 40 38 case HFSPLUS_IOC_EXT2_SETFLAGS: { 41 39 int err = 0; 42 40 err = mnt_want_write(filp->f_path.mnt); 43 - if (err) 41 + if (err) { 42 + unlock_kernel(); 44 43 return err; 44 + } 45 45 46 46 if (!is_owner_or_cap(inode)) { 47 47 err = -EACCES; ··· 89 85 mark_inode_dirty(inode); 90 86 setflags_out: 91 87 mnt_drop_write(filp->f_path.mnt); 88 + unlock_kernel(); 92 89 return err; 93 90 } 94 91 default: 92 + unlock_kernel(); 95 93 return -ENOTTY; 96 94 } 97 95 }