@@ -2432,7 +2432,6 @@ static int ext4_dx_add_entry(handle_t *handle, struct ext4_filename *fname,
if (err != -ENOSPC)
goto cleanup;
- err = 0;
/* Block full, should compress but for now just split */
dxtrace(printk(KERN_DEBUG "using %u of %u node entries\n",
dx_get_count(entries), dx_get_limit(entries)));
@@ -2507,7 +2506,7 @@ static int ext4_dx_add_entry(handle_t *handle, struct ext4_filename *fname,
/* Which index block gets the new entry? */
if (at - entries >= icount1) {
frame->at = at - entries - icount1 + entries2;
- frame->entries = entries = entries2;
+ frame->entries = entries2;
swap(frame->bh, bh2);
}
dx_insert_block((frame - 1), hash2, newblock);
@@ -3183,8 +3182,6 @@ int __ext4_unlink(handle_t *handle, struct inode *dir, const struct qstr *d_name
retval = ext4_mark_inode_dirty(handle, dir);
if (retval)
goto out;
- } else {
- retval = 0;
}
if (inode->i_nlink == 0)
ext4_warning_inode(inode, "Deleting file '%.*s' with no links",
Just assigning the 'frame' variable to 'entries2' is sufficient, rather than to 'entries = entries2'. This also removes two other cases where variables are assigned to values that are never read afterwards, making the code more legible and efficient. Signed-off-by: Milan Lakhani <milan.lakhani@codethink.co.uk> --- fs/ext4/namei.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)