void unionfs_destroy_filldir_cache(void)
{
- if (unionfs_filldir_cachep)
+ if (likely(unionfs_filldir_cachep))
kmem_cache_destroy(unionfs_filldir_cachep);
}
return UNIONFS_I(inode)->hashsize;
for (bindex = ibstart(inode); bindex <= ibend(inode); bindex++) {
- if (!(lower_inode = unionfs_lower_inode_idx(inode, bindex)))
+ lower_inode = unionfs_lower_inode_idx(inode, bindex);
+ if (unlikely(!lower_inode))
continue;
if (lower_inode->i_size == DENTPAGE)
sizeof(struct list_head);
rdstate = kmalloc(mallocsize, GFP_KERNEL);
- if (!rdstate)
+ if (unlikely(!rdstate))
return NULL;
spin_lock(&UNIONFS_I(inode)->rdlock);
* if the duplicate is in this branch, then the file
* system is corrupted.
*/
- if (cursor->bindex == rdstate->bindex) {
+ if (unlikely(cursor->bindex == rdstate->bindex)) {
printk(KERN_DEBUG "unionfs: filldir: possible "
"I/O error: a file is duplicated "
"in the same branch %d: %s\n",
}
}
- if (!found)
+ if (unlikely(!found))
cursor = NULL;
return cursor;
head = &(rdstate->list[index]);
new = kmem_cache_alloc(unionfs_filldir_cachep, GFP_KERNEL);
- if (!new) {
+ if (unlikely(!new)) {
err = -ENOMEM;
goto out;
}
new->name = new->iname;
else {
new->name = kmalloc(namelen + 1, GFP_KERNEL);
- if (!new->name) {
+ if (unlikely(!new->name)) {
kmem_cache_free(unionfs_filldir_cachep, new);
new = NULL;
goto out;