#include <asm/uaccess.h>
#include <asm/unistd.h>
-const struct file_operations generic_ro_fops = {
+struct file_operations generic_ro_fops = {
.llseek = generic_file_llseek,
.read = generic_file_read,
.mmap = generic_file_readonly_mmap,
goto Einval;
inode = file->f_dentry->d_inode;
- if (unlikely(inode->i_flock && MANDATORY_LOCK(inode))) {
+ if (inode->i_flock && MANDATORY_LOCK(inode)) {
int retval = locks_mandatory_area(
read_write == READ ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE,
inode, file, pos, count);
return ret;
}
-EXPORT_SYMBOL_GPL(sys_write);
-
asmlinkage ssize_t sys_pread64(unsigned int fd, char __user *buf,
size_t count, loff_t pos)
{
return seg;
}
-EXPORT_UNUSED_SYMBOL(iov_shorten); /* June 2006 */
+EXPORT_SYMBOL(iov_shorten);
/* A write operation does a read from user space and vice versa */
#define vrfy_dir(type) ((type) == READ ? VERIFY_WRITE : VERIFY_READ)
* verify all the pointers
*/
ret = -EINVAL;
- if (nr_segs > UIO_MAXIOV)
+ if ((nr_segs > UIO_MAXIOV) || (nr_segs <= 0))
goto out;
if (!file->f_op)
goto out;