diff options
author | Goldwyn Rodrigues <rgoldwyn@suse.de> | 2013-11-12 18:06:52 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-12 22:09:00 -0500 |
commit | 06f9da6e826a0b459652b98a21541bca274bd440 (patch) | |
tree | 6fe8423a67c3c50e664b43ea0d772b09e63e5849 /fs/ocfs2 | |
parent | 59c36455d061e200f386e1817362f6afd6265b6a (diff) |
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>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/aops.c | 3 | ||||
-rw-r--r-- | fs/ocfs2/dir.c | 4 | ||||
-rw-r--r-- | fs/ocfs2/file.c | 3 | ||||
-rw-r--r-- | fs/ocfs2/journal.h | 3 | ||||
-rw-r--r-- | fs/ocfs2/move_extents.c | 3 | ||||
-rw-r--r-- | fs/ocfs2/refcounttree.c | 9 | ||||
-rw-r--r-- | fs/ocfs2/xattr.c | 20 |
7 files changed, 16 insertions, 29 deletions
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index f37d3c0e2053..c0d4797618ef 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c | |||
@@ -1802,8 +1802,7 @@ try_again: | |||
1802 | data_ac->ac_resv = &OCFS2_I(inode)->ip_la_data_resv; | 1802 | data_ac->ac_resv = &OCFS2_I(inode)->ip_la_data_resv; |
1803 | 1803 | ||
1804 | credits = ocfs2_calc_extend_credits(inode->i_sb, | 1804 | credits = ocfs2_calc_extend_credits(inode->i_sb, |
1805 | &di->id2.i_list, | 1805 | &di->id2.i_list); |
1806 | clusters_to_alloc); | ||
1807 | 1806 | ||
1808 | } | 1807 | } |
1809 | 1808 | ||
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 30544ce8e9f7..93b079115edc 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c | |||
@@ -3284,7 +3284,7 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb, | |||
3284 | if (ocfs2_dir_resv_allowed(osb)) | 3284 | if (ocfs2_dir_resv_allowed(osb)) |
3285 | data_ac->ac_resv = &OCFS2_I(dir)->ip_la_data_resv; | 3285 | data_ac->ac_resv = &OCFS2_I(dir)->ip_la_data_resv; |
3286 | 3286 | ||
3287 | credits = ocfs2_calc_extend_credits(sb, el, 1); | 3287 | credits = ocfs2_calc_extend_credits(sb, el); |
3288 | } else { | 3288 | } else { |
3289 | spin_unlock(&OCFS2_I(dir)->ip_lock); | 3289 | spin_unlock(&OCFS2_I(dir)->ip_lock); |
3290 | credits = OCFS2_SIMPLE_DIR_EXTEND_CREDITS; | 3290 | credits = OCFS2_SIMPLE_DIR_EXTEND_CREDITS; |
@@ -3716,7 +3716,7 @@ static int ocfs2_dx_dir_rebalance_credits(struct ocfs2_super *osb, | |||
3716 | { | 3716 | { |
3717 | int credits = ocfs2_clusters_to_blocks(osb->sb, 2); | 3717 | int credits = ocfs2_clusters_to_blocks(osb->sb, 2); |
3718 | 3718 | ||
3719 | credits += ocfs2_calc_extend_credits(osb->sb, &dx_root->dr_list, 1); | 3719 | credits += ocfs2_calc_extend_credits(osb->sb, &dx_root->dr_list); |
3720 | credits += ocfs2_quota_trans_credits(osb->sb); | 3720 | credits += ocfs2_quota_trans_credits(osb->sb); |
3721 | return credits; | 3721 | return credits; |
3722 | } | 3722 | } |
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index d71903c6068b..67c037af301a 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -603,8 +603,7 @@ restart_all: | |||
603 | goto leave; | 603 | goto leave; |
604 | } | 604 | } |
605 | 605 | ||
606 | credits = ocfs2_calc_extend_credits(osb->sb, &fe->id2.i_list, | 606 | credits = ocfs2_calc_extend_credits(osb->sb, &fe->id2.i_list); |
607 | clusters_to_add); | ||
608 | handle = ocfs2_start_trans(osb, credits); | 607 | handle = ocfs2_start_trans(osb, credits); |
609 | if (IS_ERR(handle)) { | 608 | if (IS_ERR(handle)) { |
610 | status = PTR_ERR(handle); | 609 | status = PTR_ERR(handle); |
diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h index 0b479bab3671..9ff4e8cf9d97 100644 --- a/fs/ocfs2/journal.h +++ b/fs/ocfs2/journal.h | |||
@@ -524,8 +524,7 @@ static inline int ocfs2_calc_dxi_expand_credits(struct super_block *sb) | |||
524 | * the result may be wrong. | 524 | * the result may be wrong. |
525 | */ | 525 | */ |
526 | static inline int ocfs2_calc_extend_credits(struct super_block *sb, | 526 | static inline int ocfs2_calc_extend_credits(struct super_block *sb, |
527 | struct ocfs2_extent_list *root_el, | 527 | struct ocfs2_extent_list *root_el) |
528 | u32 bits_wanted) | ||
529 | { | 528 | { |
530 | int bitmap_blocks, sysfile_bitmap_blocks, extent_blocks; | 529 | int bitmap_blocks, sysfile_bitmap_blocks, extent_blocks; |
531 | 530 | ||
diff --git a/fs/ocfs2/move_extents.c b/fs/ocfs2/move_extents.c index 3d3f3c83065c..445678d9163c 100644 --- a/fs/ocfs2/move_extents.c +++ b/fs/ocfs2/move_extents.c | |||
@@ -201,8 +201,7 @@ static int ocfs2_lock_allocators_move_extents(struct inode *inode, | |||
201 | } | 201 | } |
202 | } | 202 | } |
203 | 203 | ||
204 | *credits += ocfs2_calc_extend_credits(osb->sb, et->et_root_el, | 204 | *credits += ocfs2_calc_extend_credits(osb->sb, et->et_root_el); |
205 | clusters_to_move + 2); | ||
206 | 205 | ||
207 | mlog(0, "reserve metadata_blocks: %d, data_clusters: %u, credits: %d\n", | 206 | mlog(0, "reserve metadata_blocks: %d, data_clusters: %u, credits: %d\n", |
208 | extra_blocks, clusters_to_move, *credits); | 207 | extra_blocks, clusters_to_move, *credits); |
diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index bf4dfc14bb2c..0022192e7ac8 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c | |||
@@ -2502,8 +2502,7 @@ static int ocfs2_calc_refcount_meta_credits(struct super_block *sb, | |||
2502 | ocfs2_init_refcount_extent_tree(&et, ci, ref_root_bh); | 2502 | ocfs2_init_refcount_extent_tree(&et, ci, ref_root_bh); |
2503 | *meta_add += ocfs2_extend_meta_needed(et.et_root_el); | 2503 | *meta_add += ocfs2_extend_meta_needed(et.et_root_el); |
2504 | *credits += ocfs2_calc_extend_credits(sb, | 2504 | *credits += ocfs2_calc_extend_credits(sb, |
2505 | et.et_root_el, | 2505 | et.et_root_el); |
2506 | ref_blocks); | ||
2507 | } else { | 2506 | } else { |
2508 | *credits += OCFS2_EXPAND_REFCOUNT_TREE_CREDITS; | 2507 | *credits += OCFS2_EXPAND_REFCOUNT_TREE_CREDITS; |
2509 | *meta_add += 1; | 2508 | *meta_add += 1; |
@@ -2874,8 +2873,7 @@ static int ocfs2_lock_refcount_allocators(struct super_block *sb, | |||
2874 | meta_add = | 2873 | meta_add = |
2875 | ocfs2_extend_meta_needed(et->et_root_el); | 2874 | ocfs2_extend_meta_needed(et->et_root_el); |
2876 | 2875 | ||
2877 | *credits += ocfs2_calc_extend_credits(sb, et->et_root_el, | 2876 | *credits += ocfs2_calc_extend_credits(sb, et->et_root_el); |
2878 | num_clusters + 2); | ||
2879 | 2877 | ||
2880 | ret = ocfs2_calc_refcount_meta_credits(sb, ref_ci, ref_root_bh, | 2878 | ret = ocfs2_calc_refcount_meta_credits(sb, ref_ci, ref_root_bh, |
2881 | p_cluster, num_clusters, | 2879 | p_cluster, num_clusters, |
@@ -3625,8 +3623,7 @@ int ocfs2_refcounted_xattr_delete_need(struct inode *inode, | |||
3625 | 3623 | ||
3626 | ocfs2_init_refcount_extent_tree(&et, ref_ci, ref_root_bh); | 3624 | ocfs2_init_refcount_extent_tree(&et, ref_ci, ref_root_bh); |
3627 | *credits += ocfs2_calc_extend_credits(inode->i_sb, | 3625 | *credits += ocfs2_calc_extend_credits(inode->i_sb, |
3628 | et.et_root_el, | 3626 | et.et_root_el); |
3629 | ref_blocks); | ||
3630 | } | 3627 | } |
3631 | 3628 | ||
3632 | out: | 3629 | out: |
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 6ce0686eab72..aaaab8ba82ab 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
@@ -754,8 +754,7 @@ static int ocfs2_xattr_extend_allocation(struct inode *inode, | |||
754 | BUG_ON(why == RESTART_META); | 754 | BUG_ON(why == RESTART_META); |
755 | 755 | ||
756 | credits = ocfs2_calc_extend_credits(inode->i_sb, | 756 | credits = ocfs2_calc_extend_credits(inode->i_sb, |
757 | &vb->vb_xv->xr_list, | 757 | &vb->vb_xv->xr_list); |
758 | clusters_to_add); | ||
759 | status = ocfs2_extend_trans(handle, credits); | 758 | status = ocfs2_extend_trans(handle, credits); |
760 | if (status < 0) { | 759 | if (status < 0) { |
761 | status = -ENOMEM; | 760 | status = -ENOMEM; |
@@ -3040,8 +3039,7 @@ static int ocfs2_calc_xattr_set_need(struct inode *inode, | |||
3040 | if (xi->xi_value_len > OCFS2_XATTR_INLINE_SIZE) { | 3039 | if (xi->xi_value_len > OCFS2_XATTR_INLINE_SIZE) { |
3041 | clusters_add += new_clusters; | 3040 | clusters_add += new_clusters; |
3042 | credits += ocfs2_calc_extend_credits(inode->i_sb, | 3041 | credits += ocfs2_calc_extend_credits(inode->i_sb, |
3043 | &def_xv.xv.xr_list, | 3042 | &def_xv.xv.xr_list); |
3044 | new_clusters); | ||
3045 | } | 3043 | } |
3046 | 3044 | ||
3047 | goto meta_guess; | 3045 | goto meta_guess; |
@@ -3106,8 +3104,7 @@ static int ocfs2_calc_xattr_set_need(struct inode *inode, | |||
3106 | if (!ocfs2_xattr_is_local(xe)) | 3104 | if (!ocfs2_xattr_is_local(xe)) |
3107 | credits += ocfs2_calc_extend_credits( | 3105 | credits += ocfs2_calc_extend_credits( |
3108 | inode->i_sb, | 3106 | inode->i_sb, |
3109 | &def_xv.xv.xr_list, | 3107 | &def_xv.xv.xr_list); |
3110 | new_clusters); | ||
3111 | goto out; | 3108 | goto out; |
3112 | } | 3109 | } |
3113 | } | 3110 | } |
@@ -3132,9 +3129,7 @@ static int ocfs2_calc_xattr_set_need(struct inode *inode, | |||
3132 | meta_add += ocfs2_extend_meta_needed(&xv->xr_list); | 3129 | meta_add += ocfs2_extend_meta_needed(&xv->xr_list); |
3133 | clusters_add += new_clusters - old_clusters; | 3130 | clusters_add += new_clusters - old_clusters; |
3134 | credits += ocfs2_calc_extend_credits(inode->i_sb, | 3131 | credits += ocfs2_calc_extend_credits(inode->i_sb, |
3135 | &xv->xr_list, | 3132 | &xv->xr_list); |
3136 | new_clusters - | ||
3137 | old_clusters); | ||
3138 | if (value_size >= OCFS2_XATTR_ROOT_SIZE) | 3133 | if (value_size >= OCFS2_XATTR_ROOT_SIZE) |
3139 | goto out; | 3134 | goto out; |
3140 | } | 3135 | } |
@@ -3180,7 +3175,7 @@ meta_guess: | |||
3180 | &xb->xb_attrs.xb_root.xt_list; | 3175 | &xb->xb_attrs.xb_root.xt_list; |
3181 | meta_add += ocfs2_extend_meta_needed(el); | 3176 | meta_add += ocfs2_extend_meta_needed(el); |
3182 | credits += ocfs2_calc_extend_credits(inode->i_sb, | 3177 | credits += ocfs2_calc_extend_credits(inode->i_sb, |
3183 | el, 1); | 3178 | el); |
3184 | } else | 3179 | } else |
3185 | credits += OCFS2_SUBALLOC_ALLOC + 1; | 3180 | credits += OCFS2_SUBALLOC_ALLOC + 1; |
3186 | 3181 | ||
@@ -6216,8 +6211,7 @@ static int ocfs2_value_metas_in_xattr_header(struct super_block *sb, | |||
6216 | le16_to_cpu(xv->xr_list.l_next_free_rec); | 6211 | le16_to_cpu(xv->xr_list.l_next_free_rec); |
6217 | 6212 | ||
6218 | *credits += ocfs2_calc_extend_credits(sb, | 6213 | *credits += ocfs2_calc_extend_credits(sb, |
6219 | &def_xv.xv.xr_list, | 6214 | &def_xv.xv.xr_list); |
6220 | le32_to_cpu(xv->xr_clusters)); | ||
6221 | 6215 | ||
6222 | /* | 6216 | /* |
6223 | * If the value is a tree with depth > 1, We don't go deep | 6217 | * 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( | |||
6782 | metas.num_metas += ocfs2_extend_meta_needed(xt_et->et_root_el); | 6776 | metas.num_metas += ocfs2_extend_meta_needed(xt_et->et_root_el); |
6783 | 6777 | ||
6784 | *credits += ocfs2_calc_extend_credits(osb->sb, | 6778 | *credits += ocfs2_calc_extend_credits(osb->sb, |
6785 | xt_et->et_root_el, len); | 6779 | xt_et->et_root_el); |
6786 | 6780 | ||
6787 | if (metas.num_metas) { | 6781 | if (metas.num_metas) { |
6788 | ret = ocfs2_reserve_new_metadata_blocks(osb, metas.num_metas, | 6782 | ret = ocfs2_reserve_new_metadata_blocks(osb, metas.num_metas, |