int err;
unionfs_read_lock(file->f_path.dentry->d_sb);
- if ((err = unionfs_file_revalidate(file, false)))
+ if (unlikely((err = unionfs_file_revalidate(file, false))))
goto out;
unionfs_check_file(file);
err = do_sync_read(file, buf, count, ppos);
- if (err >= 0)
+ if (likely(err >= 0))
touch_atime(unionfs_lower_mnt(file->f_path.dentry),
unionfs_lower_dentry(file->f_path.dentry));
struct file *file = iocb->ki_filp;
unionfs_read_lock(file->f_path.dentry->d_sb);
- if ((err = unionfs_file_revalidate(file, false)))
+ if (unlikely((err = unionfs_file_revalidate(file, false))))
goto out;
unionfs_check_file(file);
err = generic_file_aio_read(iocb, iov, nr_segs, pos);
- if (err == -EIOCBQUEUED)
+ if (unlikely(err == -EIOCBQUEUED))
err = wait_on_sync_kiocb(iocb);
- if (err >= 0)
+ if (likely(err >= 0))
touch_atime(unionfs_lower_mnt(file->f_path.dentry),
unionfs_lower_dentry(file->f_path.dentry));
int err = 0;
unionfs_read_lock(file->f_path.dentry->d_sb);
- if ((err = unionfs_file_revalidate(file, true)))
+ if (unlikely((err = unionfs_file_revalidate(file, true))))
goto out;
unionfs_check_file(file);
err = do_sync_write(file, buf, count, ppos);
/* update our inode times upon a successful lower write */
- if (err >= 0) {
+ if (likely(err >= 0)) {
unionfs_copy_attr_times(file->f_path.dentry->d_inode);
unionfs_check_file(file);
}
/* This might be deferred to mmap's writepage */
willwrite = ((vma->vm_flags | VM_SHARED | VM_WRITE) == vma->vm_flags);
- if ((err = unionfs_file_revalidate(file, willwrite)))
+ if (unlikely((err = unionfs_file_revalidate(file, willwrite))))
goto out;
unionfs_check_file(file);
* generic_file_readonly_mmap returns in that case).
*/
lower_file = unionfs_lower_file(file);
- if (willwrite && !lower_file->f_mapping->a_ops->writepage) {
+ if (unlikely(willwrite && !lower_file->f_mapping->a_ops->writepage)) {
err = -EINVAL;
printk("unionfs: branch %d file system does not support "
"writeable mmap\n", fbstart(file));
} else {
err = generic_file_mmap(file, vma);
- if (err)
+ if (unlikely(err))
printk("unionfs: generic_file_mmap failed %d\n", err);
}
out:
unionfs_read_unlock(file->f_path.dentry->d_sb);
- if (!err) {
+ if (likely(!err)) {
/* copyup could cause parent dir times to change */
unionfs_copy_attr_times(file->f_path.dentry->d_parent->d_inode);
unionfs_check_file(file);
int err = -EINVAL;
unionfs_read_lock(file->f_path.dentry->d_sb);
- if ((err = unionfs_file_revalidate(file, true)))
+ if (unlikely((err = unionfs_file_revalidate(file, true))))
goto out;
unionfs_check_file(file);
goto out;
inode = dentry->d_inode;
- if (!inode) {
+ if (unlikely(!inode)) {
printk(KERN_ERR
"unionfs: null lower inode in unionfs_fsync\n");
goto out;
}
for (bindex = bstart; bindex <= bend; bindex++) {
lower_inode = unionfs_lower_inode_idx(inode, bindex);
- if (!lower_inode || !lower_inode->i_fop->fsync)
+ if (unlikely(!lower_inode || !lower_inode->i_fop->fsync))
continue;
lower_file = unionfs_lower_file_idx(file, bindex);
lower_dentry = unionfs_lower_dentry_idx(dentry, bindex);
lower_dentry,
datasync);
mutex_unlock(&lower_inode->i_mutex);
- if (err)
+ if (unlikely(err))
goto out;
}
int err = 0;
unionfs_read_lock(file->f_path.dentry->d_sb);
- if ((err = unionfs_file_revalidate(file, true)))
+ if (unlikely((err = unionfs_file_revalidate(file, true))))
goto out;
unionfs_check_file(file);
dentry = file->f_path.dentry;
inode = dentry->d_inode;
- if (!inode) {
+ if (unlikely(!inode)) {
printk(KERN_ERR
"unionfs: null lower inode in unionfs_fasync\n");
goto out;
}
for (bindex = bstart; bindex <= bend; bindex++) {
lower_inode = unionfs_lower_inode_idx(inode, bindex);
- if (!lower_inode || !lower_inode->i_fop->fasync)
+ if (unlikely(!lower_inode || !lower_inode->i_fop->fasync))
continue;
lower_file = unionfs_lower_file_idx(file, bindex);
mutex_lock(&lower_inode->i_mutex);
err = lower_inode->i_fop->fasync(fd, lower_file, flag);
mutex_unlock(&lower_inode->i_mutex);
- if (err)
+ if (unlikely(err))
goto out;
}