mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-24 01:09:38 -05:00
fs/ocfs2: remove unnecessary variable bits_wanted from ocfs2_calc_extend_credits
Code cleanup to remove unnecessary variable passed but never used to ocfs2_calc_extend_credits. Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com> Cc: Joel Becker <jlbec@evilplan.org> Cc: Mark Fasheh <mfasheh@suse.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
59c36455d0
commit
06f9da6e82
7 changed files with 16 additions and 29 deletions
|
@ -1802,8 +1802,7 @@ try_again:
|
||||||
data_ac->ac_resv = &OCFS2_I(inode)->ip_la_data_resv;
|
data_ac->ac_resv = &OCFS2_I(inode)->ip_la_data_resv;
|
||||||
|
|
||||||
credits = ocfs2_calc_extend_credits(inode->i_sb,
|
credits = ocfs2_calc_extend_credits(inode->i_sb,
|
||||||
&di->id2.i_list,
|
&di->id2.i_list);
|
||||||
clusters_to_alloc);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3284,7 +3284,7 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb,
|
||||||
if (ocfs2_dir_resv_allowed(osb))
|
if (ocfs2_dir_resv_allowed(osb))
|
||||||
data_ac->ac_resv = &OCFS2_I(dir)->ip_la_data_resv;
|
data_ac->ac_resv = &OCFS2_I(dir)->ip_la_data_resv;
|
||||||
|
|
||||||
credits = ocfs2_calc_extend_credits(sb, el, 1);
|
credits = ocfs2_calc_extend_credits(sb, el);
|
||||||
} else {
|
} else {
|
||||||
spin_unlock(&OCFS2_I(dir)->ip_lock);
|
spin_unlock(&OCFS2_I(dir)->ip_lock);
|
||||||
credits = OCFS2_SIMPLE_DIR_EXTEND_CREDITS;
|
credits = OCFS2_SIMPLE_DIR_EXTEND_CREDITS;
|
||||||
|
@ -3716,7 +3716,7 @@ static int ocfs2_dx_dir_rebalance_credits(struct ocfs2_super *osb,
|
||||||
{
|
{
|
||||||
int credits = ocfs2_clusters_to_blocks(osb->sb, 2);
|
int credits = ocfs2_clusters_to_blocks(osb->sb, 2);
|
||||||
|
|
||||||
credits += ocfs2_calc_extend_credits(osb->sb, &dx_root->dr_list, 1);
|
credits += ocfs2_calc_extend_credits(osb->sb, &dx_root->dr_list);
|
||||||
credits += ocfs2_quota_trans_credits(osb->sb);
|
credits += ocfs2_quota_trans_credits(osb->sb);
|
||||||
return credits;
|
return credits;
|
||||||
}
|
}
|
||||||
|
|
|
@ -603,8 +603,7 @@ restart_all:
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
|
||||||
credits = ocfs2_calc_extend_credits(osb->sb, &fe->id2.i_list,
|
credits = ocfs2_calc_extend_credits(osb->sb, &fe->id2.i_list);
|
||||||
clusters_to_add);
|
|
||||||
handle = ocfs2_start_trans(osb, credits);
|
handle = ocfs2_start_trans(osb, credits);
|
||||||
if (IS_ERR(handle)) {
|
if (IS_ERR(handle)) {
|
||||||
status = PTR_ERR(handle);
|
status = PTR_ERR(handle);
|
||||||
|
|
|
@ -524,8 +524,7 @@ static inline int ocfs2_calc_dxi_expand_credits(struct super_block *sb)
|
||||||
* the result may be wrong.
|
* the result may be wrong.
|
||||||
*/
|
*/
|
||||||
static inline int ocfs2_calc_extend_credits(struct super_block *sb,
|
static inline int ocfs2_calc_extend_credits(struct super_block *sb,
|
||||||
struct ocfs2_extent_list *root_el,
|
struct ocfs2_extent_list *root_el)
|
||||||
u32 bits_wanted)
|
|
||||||
{
|
{
|
||||||
int bitmap_blocks, sysfile_bitmap_blocks, extent_blocks;
|
int bitmap_blocks, sysfile_bitmap_blocks, extent_blocks;
|
||||||
|
|
||||||
|
|
|
@ -201,8 +201,7 @@ static int ocfs2_lock_allocators_move_extents(struct inode *inode,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*credits += ocfs2_calc_extend_credits(osb->sb, et->et_root_el,
|
*credits += ocfs2_calc_extend_credits(osb->sb, et->et_root_el);
|
||||||
clusters_to_move + 2);
|
|
||||||
|
|
||||||
mlog(0, "reserve metadata_blocks: %d, data_clusters: %u, credits: %d\n",
|
mlog(0, "reserve metadata_blocks: %d, data_clusters: %u, credits: %d\n",
|
||||||
extra_blocks, clusters_to_move, *credits);
|
extra_blocks, clusters_to_move, *credits);
|
||||||
|
|
|
@ -2502,8 +2502,7 @@ static int ocfs2_calc_refcount_meta_credits(struct super_block *sb,
|
||||||
ocfs2_init_refcount_extent_tree(&et, ci, ref_root_bh);
|
ocfs2_init_refcount_extent_tree(&et, ci, ref_root_bh);
|
||||||
*meta_add += ocfs2_extend_meta_needed(et.et_root_el);
|
*meta_add += ocfs2_extend_meta_needed(et.et_root_el);
|
||||||
*credits += ocfs2_calc_extend_credits(sb,
|
*credits += ocfs2_calc_extend_credits(sb,
|
||||||
et.et_root_el,
|
et.et_root_el);
|
||||||
ref_blocks);
|
|
||||||
} else {
|
} else {
|
||||||
*credits += OCFS2_EXPAND_REFCOUNT_TREE_CREDITS;
|
*credits += OCFS2_EXPAND_REFCOUNT_TREE_CREDITS;
|
||||||
*meta_add += 1;
|
*meta_add += 1;
|
||||||
|
@ -2874,8 +2873,7 @@ static int ocfs2_lock_refcount_allocators(struct super_block *sb,
|
||||||
meta_add =
|
meta_add =
|
||||||
ocfs2_extend_meta_needed(et->et_root_el);
|
ocfs2_extend_meta_needed(et->et_root_el);
|
||||||
|
|
||||||
*credits += ocfs2_calc_extend_credits(sb, et->et_root_el,
|
*credits += ocfs2_calc_extend_credits(sb, et->et_root_el);
|
||||||
num_clusters + 2);
|
|
||||||
|
|
||||||
ret = ocfs2_calc_refcount_meta_credits(sb, ref_ci, ref_root_bh,
|
ret = ocfs2_calc_refcount_meta_credits(sb, ref_ci, ref_root_bh,
|
||||||
p_cluster, num_clusters,
|
p_cluster, num_clusters,
|
||||||
|
@ -3625,8 +3623,7 @@ int ocfs2_refcounted_xattr_delete_need(struct inode *inode,
|
||||||
|
|
||||||
ocfs2_init_refcount_extent_tree(&et, ref_ci, ref_root_bh);
|
ocfs2_init_refcount_extent_tree(&et, ref_ci, ref_root_bh);
|
||||||
*credits += ocfs2_calc_extend_credits(inode->i_sb,
|
*credits += ocfs2_calc_extend_credits(inode->i_sb,
|
||||||
et.et_root_el,
|
et.et_root_el);
|
||||||
ref_blocks);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
|
|
@ -754,8 +754,7 @@ static int ocfs2_xattr_extend_allocation(struct inode *inode,
|
||||||
BUG_ON(why == RESTART_META);
|
BUG_ON(why == RESTART_META);
|
||||||
|
|
||||||
credits = ocfs2_calc_extend_credits(inode->i_sb,
|
credits = ocfs2_calc_extend_credits(inode->i_sb,
|
||||||
&vb->vb_xv->xr_list,
|
&vb->vb_xv->xr_list);
|
||||||
clusters_to_add);
|
|
||||||
status = ocfs2_extend_trans(handle, credits);
|
status = ocfs2_extend_trans(handle, credits);
|
||||||
if (status < 0) {
|
if (status < 0) {
|
||||||
status = -ENOMEM;
|
status = -ENOMEM;
|
||||||
|
@ -3040,8 +3039,7 @@ static int ocfs2_calc_xattr_set_need(struct inode *inode,
|
||||||
if (xi->xi_value_len > OCFS2_XATTR_INLINE_SIZE) {
|
if (xi->xi_value_len > OCFS2_XATTR_INLINE_SIZE) {
|
||||||
clusters_add += new_clusters;
|
clusters_add += new_clusters;
|
||||||
credits += ocfs2_calc_extend_credits(inode->i_sb,
|
credits += ocfs2_calc_extend_credits(inode->i_sb,
|
||||||
&def_xv.xv.xr_list,
|
&def_xv.xv.xr_list);
|
||||||
new_clusters);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
goto meta_guess;
|
goto meta_guess;
|
||||||
|
@ -3106,8 +3104,7 @@ static int ocfs2_calc_xattr_set_need(struct inode *inode,
|
||||||
if (!ocfs2_xattr_is_local(xe))
|
if (!ocfs2_xattr_is_local(xe))
|
||||||
credits += ocfs2_calc_extend_credits(
|
credits += ocfs2_calc_extend_credits(
|
||||||
inode->i_sb,
|
inode->i_sb,
|
||||||
&def_xv.xv.xr_list,
|
&def_xv.xv.xr_list);
|
||||||
new_clusters);
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3132,9 +3129,7 @@ static int ocfs2_calc_xattr_set_need(struct inode *inode,
|
||||||
meta_add += ocfs2_extend_meta_needed(&xv->xr_list);
|
meta_add += ocfs2_extend_meta_needed(&xv->xr_list);
|
||||||
clusters_add += new_clusters - old_clusters;
|
clusters_add += new_clusters - old_clusters;
|
||||||
credits += ocfs2_calc_extend_credits(inode->i_sb,
|
credits += ocfs2_calc_extend_credits(inode->i_sb,
|
||||||
&xv->xr_list,
|
&xv->xr_list);
|
||||||
new_clusters -
|
|
||||||
old_clusters);
|
|
||||||
if (value_size >= OCFS2_XATTR_ROOT_SIZE)
|
if (value_size >= OCFS2_XATTR_ROOT_SIZE)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -3180,7 +3175,7 @@ meta_guess:
|
||||||
&xb->xb_attrs.xb_root.xt_list;
|
&xb->xb_attrs.xb_root.xt_list;
|
||||||
meta_add += ocfs2_extend_meta_needed(el);
|
meta_add += ocfs2_extend_meta_needed(el);
|
||||||
credits += ocfs2_calc_extend_credits(inode->i_sb,
|
credits += ocfs2_calc_extend_credits(inode->i_sb,
|
||||||
el, 1);
|
el);
|
||||||
} else
|
} else
|
||||||
credits += OCFS2_SUBALLOC_ALLOC + 1;
|
credits += OCFS2_SUBALLOC_ALLOC + 1;
|
||||||
|
|
||||||
|
@ -6216,8 +6211,7 @@ static int ocfs2_value_metas_in_xattr_header(struct super_block *sb,
|
||||||
le16_to_cpu(xv->xr_list.l_next_free_rec);
|
le16_to_cpu(xv->xr_list.l_next_free_rec);
|
||||||
|
|
||||||
*credits += ocfs2_calc_extend_credits(sb,
|
*credits += ocfs2_calc_extend_credits(sb,
|
||||||
&def_xv.xv.xr_list,
|
&def_xv.xv.xr_list);
|
||||||
le32_to_cpu(xv->xr_clusters));
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the value is a tree with depth > 1, We don't go deep
|
* If the value is a tree with depth > 1, We don't go deep
|
||||||
|
@ -6782,7 +6776,7 @@ static int ocfs2_lock_reflink_xattr_rec_allocators(
|
||||||
metas.num_metas += ocfs2_extend_meta_needed(xt_et->et_root_el);
|
metas.num_metas += ocfs2_extend_meta_needed(xt_et->et_root_el);
|
||||||
|
|
||||||
*credits += ocfs2_calc_extend_credits(osb->sb,
|
*credits += ocfs2_calc_extend_credits(osb->sb,
|
||||||
xt_et->et_root_el, len);
|
xt_et->et_root_el);
|
||||||
|
|
||||||
if (metas.num_metas) {
|
if (metas.num_metas) {
|
||||||
ret = ocfs2_reserve_new_metadata_blocks(osb, metas.num_metas,
|
ret = ocfs2_reserve_new_metadata_blocks(osb, metas.num_metas,
|
||||||
|
|
Loading…
Add table
Reference in a new issue