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 /drivers/mtd | |
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 'drivers/mtd')
-rw-r--r-- | drivers/mtd/mtdchar.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index 8bb5e4a66328..000d65ea55a4 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c | |||
@@ -468,8 +468,7 @@ static int mtd_do_readoob(struct mtd_info *mtd, uint64_t start, | |||
468 | return ret; | 468 | return ret; |
469 | } | 469 | } |
470 | 470 | ||
471 | static int mtd_ioctl(struct inode *inode, struct file *file, | 471 | static int mtd_ioctl(struct file *file, u_int cmd, u_long arg) |
472 | u_int cmd, u_long arg) | ||
473 | { | 472 | { |
474 | struct mtd_file_info *mfi = file->private_data; | 473 | struct mtd_file_info *mfi = file->private_data; |
475 | struct mtd_info *mtd = mfi->mtd; | 474 | struct mtd_info *mtd = mfi->mtd; |
@@ -840,6 +839,17 @@ static int mtd_ioctl(struct inode *inode, struct file *file, | |||
840 | return ret; | 839 | return ret; |
841 | } /* memory_ioctl */ | 840 | } /* memory_ioctl */ |
842 | 841 | ||
842 | static long mtd_unlocked_ioctl(struct file *file, u_int cmd, u_long arg) | ||
843 | { | ||
844 | int ret; | ||
845 | |||
846 | lock_kernel(); | ||
847 | ret = mtd_ioctl(file, cmd, arg); | ||
848 | unlock_kernel(); | ||
849 | |||
850 | return ret; | ||
851 | } | ||
852 | |||
843 | #ifdef CONFIG_COMPAT | 853 | #ifdef CONFIG_COMPAT |
844 | 854 | ||
845 | struct mtd_oob_buf32 { | 855 | struct mtd_oob_buf32 { |
@@ -854,7 +864,6 @@ struct mtd_oob_buf32 { | |||
854 | static long mtd_compat_ioctl(struct file *file, unsigned int cmd, | 864 | static long mtd_compat_ioctl(struct file *file, unsigned int cmd, |
855 | unsigned long arg) | 865 | unsigned long arg) |
856 | { | 866 | { |
857 | struct inode *inode = file->f_path.dentry->d_inode; | ||
858 | struct mtd_file_info *mfi = file->private_data; | 867 | struct mtd_file_info *mfi = file->private_data; |
859 | struct mtd_info *mtd = mfi->mtd; | 868 | struct mtd_info *mtd = mfi->mtd; |
860 | void __user *argp = compat_ptr(arg); | 869 | void __user *argp = compat_ptr(arg); |
@@ -892,7 +901,7 @@ static long mtd_compat_ioctl(struct file *file, unsigned int cmd, | |||
892 | break; | 901 | break; |
893 | } | 902 | } |
894 | default: | 903 | default: |
895 | ret = mtd_ioctl(inode, file, cmd, (unsigned long)argp); | 904 | ret = mtd_ioctl(file, cmd, (unsigned long)argp); |
896 | } | 905 | } |
897 | 906 | ||
898 | unlock_kernel(); | 907 | unlock_kernel(); |
@@ -960,7 +969,7 @@ static const struct file_operations mtd_fops = { | |||
960 | .llseek = mtd_lseek, | 969 | .llseek = mtd_lseek, |
961 | .read = mtd_read, | 970 | .read = mtd_read, |
962 | .write = mtd_write, | 971 | .write = mtd_write, |
963 | .ioctl = mtd_ioctl, | 972 | .unlocked_ioctl = mtd_unlocked_ioctl, |
964 | #ifdef CONFIG_COMPAT | 973 | #ifdef CONFIG_COMPAT |
965 | .compat_ioctl = mtd_compat_ioctl, | 974 | .compat_ioctl = mtd_compat_ioctl, |
966 | #endif | 975 | #endif |