diff options
author | Arnd Bergmann <arnd@arndb.de> | 2010-04-28 08:36:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-04-29 11:44:37 -0400 |
commit | f80a0ca6ad8f2800453e819dafa09a0ed9e56850 (patch) | |
tree | bdbffa0e212888c31e11e89dc1194935f6825085 | |
parent | a36fed12a4d980eebb2e67b87ea30ad090238cff (diff) |
pktcdvd: improve BKL and compat_ioctl.c usage
The pktcdvd driver uses proper locking and does not need the BKL in the
ioctl and llseek functions of the character device, so kill both.
Moving the compat_ioctl handling from common code into the driver itself
fixes build problems when CONFIG_BLOCK is disabled.
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/block/pktcdvd.c | 17 | ||||
-rw-r--r-- | fs/compat_ioctl.c | 3 |
2 files changed, 14 insertions, 6 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index ddf19425245d..8a549db2aa78 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -48,6 +48,7 @@ | |||
48 | #include <linux/module.h> | 48 | #include <linux/module.h> |
49 | #include <linux/types.h> | 49 | #include <linux/types.h> |
50 | #include <linux/kernel.h> | 50 | #include <linux/kernel.h> |
51 | #include <linux/compat.h> | ||
51 | #include <linux/kthread.h> | 52 | #include <linux/kthread.h> |
52 | #include <linux/errno.h> | 53 | #include <linux/errno.h> |
53 | #include <linux/spinlock.h> | 54 | #include <linux/spinlock.h> |
@@ -2984,7 +2985,7 @@ static void pkt_get_status(struct pkt_ctrl_command *ctrl_cmd) | |||
2984 | mutex_unlock(&ctl_mutex); | 2985 | mutex_unlock(&ctl_mutex); |
2985 | } | 2986 | } |
2986 | 2987 | ||
2987 | static int pkt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) | 2988 | static long pkt_ctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
2988 | { | 2989 | { |
2989 | void __user *argp = (void __user *)arg; | 2990 | void __user *argp = (void __user *)arg; |
2990 | struct pkt_ctrl_command ctrl_cmd; | 2991 | struct pkt_ctrl_command ctrl_cmd; |
@@ -3021,10 +3022,20 @@ static int pkt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cm | |||
3021 | return ret; | 3022 | return ret; |
3022 | } | 3023 | } |
3023 | 3024 | ||
3025 | #ifdef CONFIG_COMPAT | ||
3026 | static long pkt_ctl_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | ||
3027 | { | ||
3028 | return pkt_ctl_ioctl(file, cmd, (unsigned long)compat_ptr(arg)); | ||
3029 | } | ||
3030 | #endif | ||
3024 | 3031 | ||
3025 | static const struct file_operations pkt_ctl_fops = { | 3032 | static const struct file_operations pkt_ctl_fops = { |
3026 | .ioctl = pkt_ctl_ioctl, | 3033 | .open = nonseekable_open, |
3027 | .owner = THIS_MODULE, | 3034 | .unlocked_ioctl = pkt_ctl_ioctl, |
3035 | #ifdef CONFIG_COMPAT | ||
3036 | .compat_ioctl = pkt_ctl_compat_ioctl, | ||
3037 | #endif | ||
3038 | .owner = THIS_MODULE, | ||
3028 | }; | 3039 | }; |
3029 | 3040 | ||
3030 | static struct miscdevice pkt_misc = { | 3041 | static struct miscdevice pkt_misc = { |
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c index c32a1b6a856b..641640dc7ae5 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c | |||
@@ -102,7 +102,6 @@ | |||
102 | #include <linux/nbd.h> | 102 | #include <linux/nbd.h> |
103 | #include <linux/random.h> | 103 | #include <linux/random.h> |
104 | #include <linux/filter.h> | 104 | #include <linux/filter.h> |
105 | #include <linux/pktcdvd.h> | ||
106 | 105 | ||
107 | #include <linux/hiddev.h> | 106 | #include <linux/hiddev.h> |
108 | 107 | ||
@@ -1126,8 +1125,6 @@ COMPATIBLE_IOCTL(PPGETMODE) | |||
1126 | COMPATIBLE_IOCTL(PPGETPHASE) | 1125 | COMPATIBLE_IOCTL(PPGETPHASE) |
1127 | COMPATIBLE_IOCTL(PPGETFLAGS) | 1126 | COMPATIBLE_IOCTL(PPGETFLAGS) |
1128 | COMPATIBLE_IOCTL(PPSETFLAGS) | 1127 | COMPATIBLE_IOCTL(PPSETFLAGS) |
1129 | /* pktcdvd */ | ||
1130 | COMPATIBLE_IOCTL(PACKET_CTRL_CMD) | ||
1131 | /* Big A */ | 1128 | /* Big A */ |
1132 | /* sparc only */ | 1129 | /* sparc only */ |
1133 | /* Big Q for sound/OSS */ | 1130 | /* Big Q for sound/OSS */ |