void ext4_ext_drop_refs(struct ext4_ext_path *path)
{
- int depth = path->p_depth;
- int i;
+ int depth, i;
+ if (!path)
+ return;
+ depth = path->p_depth;
for (i = 0; i <= depth; i++, path++)
if (path->p_bh) {
brelse(path->p_bh);
err = ext4_ext_dirty(handle, inode, path + path->p_depth);
cleanup:
- if (npath) {
- ext4_ext_drop_refs(npath);
- kfree(npath);
- }
+ ext4_ext_drop_refs(npath);
+ kfree(npath);
return err;
}
block = es.es_lblk + es.es_len;
}
- if (path) {
- ext4_ext_drop_refs(path);
- kfree(path);
- }
-
+ ext4_ext_drop_refs(path);
+ kfree(path);
return err;
}
}
}
out:
- if (path) {
- ext4_ext_drop_refs(path);
- kfree(path);
- path = NULL;
- }
+ ext4_ext_drop_refs(path);
+ kfree(path);
+ path = NULL;
if (err == -EAGAIN)
goto again;
ext4_journal_stop(handle);
map->m_pblk = newblock;
map->m_len = allocated;
out2:
- if (path) {
- ext4_ext_drop_refs(path);
- kfree(path);
- }
+ ext4_ext_drop_refs(path);
+ kfree(path);
trace_ext4_ext_map_blocks_exit(inode, flags, map,
err ? err : allocated);
count -= len;
repeat:
- if (path1) {
- ext4_ext_drop_refs(path1);
- kfree(path1);
- path1 = NULL;
- }
- if (path2) {
- ext4_ext_drop_refs(path2);
- kfree(path2);
- path2 = NULL;
- }
+ ext4_ext_drop_refs(path1);
+ kfree(path1);
+ ext4_ext_drop_refs(path2);
+ kfree(path2);
+ path1 = path2 = NULL;
}
return replaced_count;
}
retval = ext4_ext_insert_extent(handle, inode, &path, &newext, 0);
err_out:
up_write((&EXT4_I(inode)->i_data_sem));
- if (path) {
- ext4_ext_drop_refs(path);
- kfree(path);
- }
+ ext4_ext_drop_refs(path);
+ kfree(path);
lb->first_pblock = 0;
return retval;
}
}
ret = 1;
out:
- if (path) {
- ext4_ext_drop_refs(path);
- kfree(path);
- }
+ ext4_ext_drop_refs(path);
+ kfree(path);
return ret;
}
o_start += cur_len;
d_start += cur_len;
repeat:
- if (path) {
- ext4_ext_drop_refs(path);
- kfree(path);
- path = NULL;
- }
+ ext4_ext_drop_refs(path);
+ kfree(path);
+ path = NULL;
}
*moved_len = o_start - orig_blk;
if (*moved_len > len)
ext4_discard_preallocations(donor_inode);
}
- if (path) {
- ext4_ext_drop_refs(path);
- kfree(path);
- }
+ ext4_ext_drop_refs(path);
+ kfree(path);
ext4_double_up_write_data_sem(orig_inode, donor_inode);
ext4_inode_resume_unlocked_dio(orig_inode);
ext4_inode_resume_unlocked_dio(donor_inode);