Commit d16044cf authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Greg Kroah-Hartman

staging: make new character devices nonseekable

As a preparation for changing the default behaviour of llseek to no_llseek,
every file_operations structure should have a .llseek operation.

There are three new instances in staging now, which can all be changed
into no_llseek explicitly since the devices do not need to seek.

Add nonseekable_open where appropriate, to prevent pread/pwrite as well.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent cff55f50
#include <linux/fs.h>
#include "headers.h" #include "headers.h"
/*************************************************************** /***************************************************************
* Function - bcm_char_open() * Function - bcm_char_open()
...@@ -35,6 +37,8 @@ static int bcm_char_open(struct inode *inode, struct file * filp) ...@@ -35,6 +37,8 @@ static int bcm_char_open(struct inode *inode, struct file * filp)
/*Start Queuing the control response Packets*/ /*Start Queuing the control response Packets*/
atomic_inc(&Adapter->ApplicationRunning); atomic_inc(&Adapter->ApplicationRunning);
nonseekable_open(inode, filp);
return 0; return 0;
} }
static int bcm_char_release(struct inode *inode, struct file *filp) static int bcm_char_release(struct inode *inode, struct file *filp)
...@@ -2360,6 +2364,7 @@ static struct file_operations bcm_fops = { ...@@ -2360,6 +2364,7 @@ static struct file_operations bcm_fops = {
.release = bcm_char_release, .release = bcm_char_release,
.read = bcm_char_read, .read = bcm_char_read,
.unlocked_ioctl = bcm_char_ioctl, .unlocked_ioctl = bcm_char_ioctl,
.llseek = no_llseek,
}; };
......
...@@ -163,6 +163,7 @@ static struct file_operations usbbcm_fops = { ...@@ -163,6 +163,7 @@ static struct file_operations usbbcm_fops = {
.read = usbbcm_read, .read = usbbcm_read,
.write = usbbcm_write, .write = usbbcm_write,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.llseek = no_llseek,
}; };
static struct usb_class_driver usbbcm_class = { static struct usb_class_driver usbbcm_class = {
......
...@@ -81,10 +81,11 @@ int numofmsgbuf = 0; ...@@ -81,10 +81,11 @@ int numofmsgbuf = 0;
// //
static struct file_operations ft1000fops = static struct file_operations ft1000fops =
{ {
unlocked_ioctl: ft1000_ChIoctl, .unlocked_ioctl = ft1000_ChIoctl,
poll: ft1000_ChPoll, .poll = ft1000_ChPoll,
open: ft1000_ChOpen, .open = ft1000_ChOpen,
release: ft1000_ChRelease .release = ft1000_ChRelease,
.llseek = no_llseek,
}; };
...@@ -470,6 +471,7 @@ static int ft1000_ChOpen (struct inode *Inode, struct file *File) ...@@ -470,6 +471,7 @@ static int ft1000_ChOpen (struct inode *Inode, struct file *File)
File->private_data = pdevobj[num]->net; File->private_data = pdevobj[num]->net;
nonseekable_open(Inode, File);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment