Skip to content

Commit

Permalink
ocfs2: clean up some unnecessary code
Browse files Browse the repository at this point in the history
Several functions have some unnecessary code, clean up these code.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Yan Wang <[email protected]>
Reviewed-by: Jun Piao <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Cc: Mark Fasheh <[email protected]>
Cc: Joel Becker <[email protected]>
Cc: Junxiao Bi <[email protected]>
Cc: Joseph Qi <[email protected]>
Cc: Changwei Ge <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
wangyan0507 authored and torvalds committed Aug 17, 2018
1 parent 93f5920 commit 229ba1f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
17 changes: 4 additions & 13 deletions fs/ocfs2/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -932,13 +932,11 @@ static int ocfs2_validate_extent_block(struct super_block *sb,
goto bail;
}

if (le32_to_cpu(eb->h_fs_generation) != OCFS2_SB(sb)->fs_generation) {
if (le32_to_cpu(eb->h_fs_generation) != OCFS2_SB(sb)->fs_generation)
rc = ocfs2_error(sb,
"Extent block #%llu has an invalid h_fs_generation of #%u\n",
(unsigned long long)bh->b_blocknr,
le32_to_cpu(eb->h_fs_generation));
goto bail;
}
bail:
return rc;
}
Expand Down Expand Up @@ -1596,10 +1594,8 @@ static int ocfs2_grow_tree(handle_t *handle, struct ocfs2_extent_tree *et,
* the new data. */
ret = ocfs2_add_branch(handle, et, bh, last_eb_bh,
meta_ac);
if (ret < 0) {
if (ret < 0)
mlog_errno(ret);
goto out;
}

out:
if (final_depth)
Expand Down Expand Up @@ -5518,10 +5514,8 @@ static int ocfs2_truncate_rec(handle_t *handle,
ocfs2_journal_dirty(handle, path_leaf_bh(path));

ret = ocfs2_rotate_tree_left(handle, et, path, dealloc);
if (ret) {
if (ret)
mlog_errno(ret);
goto out;
}

out:
ocfs2_free_path(left_path);
Expand Down Expand Up @@ -5654,10 +5648,8 @@ int ocfs2_remove_extent(handle_t *handle,

ret = ocfs2_truncate_rec(handle, et, path, index, dealloc,
cpos, len);
if (ret) {
if (ret)
mlog_errno(ret);
goto out;
}
}

out:
Expand Down Expand Up @@ -5702,7 +5694,6 @@ static int ocfs2_reserve_blocks_for_rec_trunc(struct inode *inode,
if (ret < 0) {
if (ret != -ENOSPC)
mlog_errno(ret);
goto out;
}
}

Expand Down
2 changes: 0 additions & 2 deletions fs/ocfs2/cluster/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -872,8 +872,6 @@ int o2net_register_handler(u32 msg_type, u32 key, u32 max_len,
"for type %u key %08x\n", msg_type, key);
}
write_unlock(&o2net_handler_lock);
if (ret)
goto out;

out:
if (ret)
Expand Down
5 changes: 1 addition & 4 deletions fs/ocfs2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,10 +637,8 @@ static int ocfs2_truncate_for_delete(struct ocfs2_super *osb,
handle = NULL;

status = ocfs2_commit_truncate(osb, inode, fe_bh);
if (status < 0) {
if (status < 0)
mlog_errno(status);
goto out;
}
}

out:
Expand Down Expand Up @@ -1499,7 +1497,6 @@ static int ocfs2_filecheck_validate_inode_block(struct super_block *sb,
(unsigned long long)bh->b_blocknr,
le32_to_cpu(di->i_fs_generation));
rc = -OCFS2_FILECHECK_ERR_GENERATION;
goto bail;
}

bail:
Expand Down

0 comments on commit 229ba1f

Please sign in to comment.