X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fread_write.c;fp=fs%2Fread_write.c;h=3f7a1a62165f626e984de4849ce053cc8a824f65;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=c5b80d98dfc4b22deaf534669d7d1038bceec046;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/fs/read_write.c b/fs/read_write.c index c5b80d98d..3f7a1a621 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -19,7 +19,7 @@ #include #include -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, @@ -202,7 +202,7 @@ int rw_verify_area(int read_write, struct file *file, loff_t *ppos, size_t count 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); @@ -374,8 +374,6 @@ asmlinkage ssize_t sys_write(unsigned int fd, const char __user * buf, size_t co return ret; } -EXPORT_SYMBOL_GPL(sys_write); - asmlinkage ssize_t sys_pread64(unsigned int fd, char __user *buf, size_t count, loff_t pos) { @@ -438,7 +436,7 @@ unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to) 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) @@ -472,7 +470,7 @@ static ssize_t do_readv_writev(int type, struct file *file, * 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;