* [Ocfs2-devel] [PATCH] ocfs2: clean dead code up in alloc.c
@ 2018-01-16 12:17 Changwei Ge
2018-01-16 12:40 ` piaojun
2018-01-17 1:04 ` alex chen
0 siblings, 2 replies; 3+ messages in thread
From: Changwei Ge @ 2018-01-16 12:17 UTC (permalink / raw)
To: ocfs2-devel
Some stack variables are no longer used but still assigned.
Trim them.
Signed-off-by: Changwei Ge <ge.changwei@h3c.com>
---
fs/ocfs2/alloc.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index addd7c5..edef99c 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -2598,11 +2598,8 @@ static void ocfs2_unlink_subtree(handle_t *handle,
int i;
struct buffer_head *root_bh = left_path->p_node[subtree_index].bh;
struct ocfs2_extent_list *root_el = left_path->p_node[subtree_index].el;
- struct ocfs2_extent_list *el;
struct ocfs2_extent_block *eb;
- el = path_leaf_el(left_path);
-
eb = (struct ocfs2_extent_block *)right_path->p_node[subtree_index + 1].bh->b_data;
for(i = 1; i < le16_to_cpu(root_el->l_next_free_rec); i++)
@@ -3940,7 +3937,7 @@ static void ocfs2_adjust_rightmost_records(handle_t *handle,
struct ocfs2_path *path,
struct ocfs2_extent_rec *insert_rec)
{
- int ret, i, next_free;
+ int i, next_free;
struct buffer_head *bh;
struct ocfs2_extent_list *el;
struct ocfs2_extent_rec *rec;
@@ -3957,7 +3954,6 @@ static void ocfs2_adjust_rightmost_records(handle_t *handle,
ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
"Owner %llu has a bad extent list\n",
(unsigned long long)ocfs2_metadata_cache_owner(et->et_ci));
- ret = -EIO;
return;
}
@@ -5059,7 +5055,6 @@ int ocfs2_split_extent(handle_t *handle,
struct buffer_head *last_eb_bh = NULL;
struct ocfs2_extent_rec *rec = &el->l_recs[split_index];
struct ocfs2_merge_ctxt ctxt;
- struct ocfs2_extent_list *rightmost_el;
if (le32_to_cpu(rec->e_cpos) > le32_to_cpu(split_rec->e_cpos) ||
((le32_to_cpu(rec->e_cpos) + le16_to_cpu(rec->e_leaf_clusters)) <
@@ -5095,9 +5090,7 @@ int ocfs2_split_extent(handle_t *handle,
}
eb = (struct ocfs2_extent_block *) last_eb_bh->b_data;
- rightmost_el = &eb->h_list;
- } else
- rightmost_el = path_root_el(path);
+ }
if (rec->e_cpos == split_rec->e_cpos &&
rec->e_leaf_clusters == split_rec->e_leaf_clusters)
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Ocfs2-devel] [PATCH] ocfs2: clean dead code up in alloc.c
2018-01-16 12:17 [Ocfs2-devel] [PATCH] ocfs2: clean dead code up in alloc.c Changwei Ge
@ 2018-01-16 12:40 ` piaojun
2018-01-17 1:04 ` alex chen
1 sibling, 0 replies; 3+ messages in thread
From: piaojun @ 2018-01-16 12:40 UTC (permalink / raw)
To: ocfs2-devel
Hi Changwei,
LGTM
On 2018/1/16 20:17, Changwei Ge wrote:
> Some stack variables are no longer used but still assigned.
> Trim them.
>
> Signed-off-by: Changwei Ge <ge.changwei@h3c.com>
Reviewed-by: Jun Piao <piaojun@huawei.com>
> ---
> fs/ocfs2/alloc.c | 11 ++---------
> 1 file changed, 2 insertions(+), 9 deletions(-)
>
> diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
> index addd7c5..edef99c 100644
> --- a/fs/ocfs2/alloc.c
> +++ b/fs/ocfs2/alloc.c
> @@ -2598,11 +2598,8 @@ static void ocfs2_unlink_subtree(handle_t *handle,
> int i;
> struct buffer_head *root_bh = left_path->p_node[subtree_index].bh;
> struct ocfs2_extent_list *root_el = left_path->p_node[subtree_index].el;
> - struct ocfs2_extent_list *el;
> struct ocfs2_extent_block *eb;
>
> - el = path_leaf_el(left_path);
> -
> eb = (struct ocfs2_extent_block *)right_path->p_node[subtree_index + 1].bh->b_data;
>
> for(i = 1; i < le16_to_cpu(root_el->l_next_free_rec); i++)
> @@ -3940,7 +3937,7 @@ static void ocfs2_adjust_rightmost_records(handle_t *handle,
> struct ocfs2_path *path,
> struct ocfs2_extent_rec *insert_rec)
> {
> - int ret, i, next_free;
> + int i, next_free;
> struct buffer_head *bh;
> struct ocfs2_extent_list *el;
> struct ocfs2_extent_rec *rec;
> @@ -3957,7 +3954,6 @@ static void ocfs2_adjust_rightmost_records(handle_t *handle,
> ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
> "Owner %llu has a bad extent list\n",
> (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci));
> - ret = -EIO;
> return;
> }
>
> @@ -5059,7 +5055,6 @@ int ocfs2_split_extent(handle_t *handle,
> struct buffer_head *last_eb_bh = NULL;
> struct ocfs2_extent_rec *rec = &el->l_recs[split_index];
> struct ocfs2_merge_ctxt ctxt;
> - struct ocfs2_extent_list *rightmost_el;
>
> if (le32_to_cpu(rec->e_cpos) > le32_to_cpu(split_rec->e_cpos) ||
> ((le32_to_cpu(rec->e_cpos) + le16_to_cpu(rec->e_leaf_clusters)) <
> @@ -5095,9 +5090,7 @@ int ocfs2_split_extent(handle_t *handle,
> }
>
> eb = (struct ocfs2_extent_block *) last_eb_bh->b_data;
> - rightmost_el = &eb->h_list;
> - } else
> - rightmost_el = path_root_el(path);
> + }
>
> if (rec->e_cpos == split_rec->e_cpos &&
> rec->e_leaf_clusters == split_rec->e_leaf_clusters)
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Ocfs2-devel] [PATCH] ocfs2: clean dead code up in alloc.c
2018-01-16 12:17 [Ocfs2-devel] [PATCH] ocfs2: clean dead code up in alloc.c Changwei Ge
2018-01-16 12:40 ` piaojun
@ 2018-01-17 1:04 ` alex chen
1 sibling, 0 replies; 3+ messages in thread
From: alex chen @ 2018-01-17 1:04 UTC (permalink / raw)
To: ocfs2-devel
Hi Changwei,
Looks good to me.
On 2018/1/16 20:17, Changwei Ge wrote:
> Some stack variables are no longer used but still assigned.
> Trim them.
>
> Signed-off-by: Changwei Ge <ge.changwei@h3c.com>
Reviewed-by: Alex Chen <alex.chen@huawei.com>
> ---
> fs/ocfs2/alloc.c | 11 ++---------
> 1 file changed, 2 insertions(+), 9 deletions(-)
>
> diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
> index addd7c5..edef99c 100644
> --- a/fs/ocfs2/alloc.c
> +++ b/fs/ocfs2/alloc.c
> @@ -2598,11 +2598,8 @@ static void ocfs2_unlink_subtree(handle_t *handle,
> int i;
> struct buffer_head *root_bh = left_path->p_node[subtree_index].bh;
> struct ocfs2_extent_list *root_el = left_path->p_node[subtree_index].el;
> - struct ocfs2_extent_list *el;
> struct ocfs2_extent_block *eb;
>
> - el = path_leaf_el(left_path);
> -
> eb = (struct ocfs2_extent_block *)right_path->p_node[subtree_index + 1].bh->b_data;
>
> for(i = 1; i < le16_to_cpu(root_el->l_next_free_rec); i++)
> @@ -3940,7 +3937,7 @@ static void ocfs2_adjust_rightmost_records(handle_t *handle,
> struct ocfs2_path *path,
> struct ocfs2_extent_rec *insert_rec)
> {
> - int ret, i, next_free;
> + int i, next_free;
> struct buffer_head *bh;
> struct ocfs2_extent_list *el;
> struct ocfs2_extent_rec *rec;
> @@ -3957,7 +3954,6 @@ static void ocfs2_adjust_rightmost_records(handle_t *handle,
> ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci),
> "Owner %llu has a bad extent list\n",
> (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci));
> - ret = -EIO;
> return;
> }
>
> @@ -5059,7 +5055,6 @@ int ocfs2_split_extent(handle_t *handle,
> struct buffer_head *last_eb_bh = NULL;
> struct ocfs2_extent_rec *rec = &el->l_recs[split_index];
> struct ocfs2_merge_ctxt ctxt;
> - struct ocfs2_extent_list *rightmost_el;
>
> if (le32_to_cpu(rec->e_cpos) > le32_to_cpu(split_rec->e_cpos) ||
> ((le32_to_cpu(rec->e_cpos) + le16_to_cpu(rec->e_leaf_clusters)) <
> @@ -5095,9 +5090,7 @@ int ocfs2_split_extent(handle_t *handle,
> }
>
> eb = (struct ocfs2_extent_block *) last_eb_bh->b_data;
> - rightmost_el = &eb->h_list;
> - } else
> - rightmost_el = path_root_el(path);
> + }
>
> if (rec->e_cpos == split_rec->e_cpos &&
> rec->e_leaf_clusters == split_rec->e_leaf_clusters)
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-01-17 1:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-16 12:17 [Ocfs2-devel] [PATCH] ocfs2: clean dead code up in alloc.c Changwei Ge
2018-01-16 12:40 ` piaojun
2018-01-17 1:04 ` alex chen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.