X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=fs%2Fread_write.c;h=5bc0e9234f9d7c5dd21b1e244127fece7bfa905c;hb=5e66dd6d66ffe758b39b6dcadf2330753ee1159b;hp=3f7a1a62165f626e984de4849ce053cc8a824f65;hpb=80c0531514516e43ae118ddf38424e06e5c3cb3c;p=cascardo%2Flinux.git diff --git a/fs/read_write.c b/fs/read_write.c index 3f7a1a62165f..5bc0e9234f9d 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -19,7 +19,7 @@ #include #include -struct file_operations generic_ro_fops = { +const 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 (inode->i_flock && MANDATORY_LOCK(inode)) { + if (unlikely(inode->i_flock && MANDATORY_LOCK(inode))) { int retval = locks_mandatory_area( read_write == READ ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE, inode, file, pos, count); @@ -470,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) || (nr_segs <= 0)) + if (nr_segs > UIO_MAXIOV) goto out; if (!file->f_op) goto out;