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: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+#include <linux/fs.h>
+
#include "headers.h"
/***************************************************************
* Function - bcm_char_open()
/*Start Queuing the control response Packets*/
atomic_inc(&Adapter->ApplicationRunning);
+
+ nonseekable_open(inode, filp);
return 0;
}
static int bcm_char_release(struct inode *inode, struct file *filp)
.release = bcm_char_release,
.read = bcm_char_read,
.unlocked_ioctl = bcm_char_ioctl,
+ .llseek = no_llseek,
};
.read = usbbcm_read,
.write = usbbcm_write,
.owner = THIS_MODULE,
+ .llseek = no_llseek,
};
static struct usb_class_driver usbbcm_class = {
//
static struct file_operations ft1000fops =
{
- unlocked_ioctl: ft1000_ChIoctl,
- poll: ft1000_ChPoll,
- open: ft1000_ChOpen,
- release: ft1000_ChRelease
+ .unlocked_ioctl = ft1000_ChIoctl,
+ .poll = ft1000_ChPoll,
+ .open = ft1000_ChOpen,
+ .release = ft1000_ChRelease,
+ .llseek = no_llseek,
};
File->private_data = pdevobj[num]->net;
+ nonseekable_open(Inode, File);
return 0;
}