diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2010-04-10 11:38:05 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2010-04-10 10:51:14 -0400 |
commit | 3ac26b2ee30005930117fe6a180c139c5f300faf (patch) | |
tree | 5064fa443c3a9e3b7eec7dd4b264b0eae28d5c77 | |
parent | 5da3dac8d99c9933f12286fd73fa18e26f768bea (diff) |
firewire: cdev: mark char device files as not seekable
The <linux/firewire-cdev.h> character device file ABI (i.e. /dev/fw*
character device file interface) does not make any use of lseek(),
pread(), pwrite() (or any kind of write() at all).
Use nonseekable_open() and, redundantly, set file_operations.llseek to
no_llseek to remove any doubt whether the BKL-grabbing default_llseek
handler is used. (Also shuffle file_operations initialization according
to the order of handler definitions.)
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
-rw-r--r-- | drivers/firewire/core-cdev.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c index 0d3df0927efc..9d1a1a1a83c9 100644 --- a/drivers/firewire/core-cdev.c +++ b/drivers/firewire/core-cdev.c | |||
@@ -226,7 +226,7 @@ static int fw_device_op_open(struct inode *inode, struct file *file) | |||
226 | list_add_tail(&client->link, &device->client_list); | 226 | list_add_tail(&client->link, &device->client_list); |
227 | mutex_unlock(&device->client_list_mutex); | 227 | mutex_unlock(&device->client_list_mutex); |
228 | 228 | ||
229 | return 0; | 229 | return nonseekable_open(inode, file); |
230 | } | 230 | } |
231 | 231 | ||
232 | static void queue_event(struct client *client, struct event *event, | 232 | static void queue_event(struct client *client, struct event *event, |
@@ -1495,13 +1495,13 @@ static unsigned int fw_device_op_poll(struct file *file, poll_table * pt) | |||
1495 | 1495 | ||
1496 | const struct file_operations fw_device_ops = { | 1496 | const struct file_operations fw_device_ops = { |
1497 | .owner = THIS_MODULE, | 1497 | .owner = THIS_MODULE, |
1498 | .llseek = no_llseek, | ||
1498 | .open = fw_device_op_open, | 1499 | .open = fw_device_op_open, |
1499 | .read = fw_device_op_read, | 1500 | .read = fw_device_op_read, |
1500 | .unlocked_ioctl = fw_device_op_ioctl, | 1501 | .unlocked_ioctl = fw_device_op_ioctl, |
1501 | .poll = fw_device_op_poll, | ||
1502 | .release = fw_device_op_release, | ||
1503 | .mmap = fw_device_op_mmap, | 1502 | .mmap = fw_device_op_mmap, |
1504 | 1503 | .release = fw_device_op_release, | |
1504 | .poll = fw_device_op_poll, | ||
1505 | #ifdef CONFIG_COMPAT | 1505 | #ifdef CONFIG_COMPAT |
1506 | .compat_ioctl = fw_device_op_compat_ioctl, | 1506 | .compat_ioctl = fw_device_op_compat_ioctl, |
1507 | #endif | 1507 | #endif |