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);
* @flags: splice modifier flags
*
* Will read pages from given file and fill them into a pipe.
- *
*/
ssize_t generic_file_splice_read(struct file *in, struct pipe_inode_info *pipe,
size_t len, unsigned int flags)
mutex_lock(&inode->i_mutex);
err = generic_osync_inode(mapping->host, mapping,
- OSYNC_METADATA|OSYNC_DATA);
+ OSYNC_METADATA|OSYNC_DATA);
mutex_unlock(&inode->i_mutex);
if (err)
loff_t pos;
int ret;
- if (!out->f_op || !out->f_op->splice_write)
+ if (unlikely(!out->f_op || !out->f_op->splice_write))
return -EINVAL;
- if (!(out->f_mode & FMODE_WRITE))
+ if (unlikely(!(out->f_mode & FMODE_WRITE)))
return -EBADF;
pos = out->f_pos;
loff_t pos, isize, left;
int ret;
- if (!in->f_op || !in->f_op->splice_read)
+ if (unlikely(!in->f_op || !in->f_op->splice_read))
return -EINVAL;
- if (!(in->f_mode & FMODE_READ))
+ if (unlikely(!(in->f_mode & FMODE_READ)))
return -EBADF;
pos = in->f_pos;
return 0;
left = isize - in->f_pos;
- if (left < len)
+ if (unlikely(left < len))
len = left;
return in->f_op->splice_read(in, pipe, len, flags);
* 'out' and transfer the wanted data from 'in' to 'out' through that
*/
pipe = current->splice_pipe;
- if (!pipe) {
+ if (unlikely(!pipe)) {
pipe = alloc_pipe_info(NULL);
if (!pipe)
return -ENOMEM;