summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/alloc.c
diff options
context:
space:
mode:
authorJun Piao <piaojun@huawei.com>2017-09-06 19:19:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-09-06 20:27:24 -0400
commit964f14a0d350486d17cfd24b3b7dc4f7c4bdc4d3 (patch)
tree20fb517267d900c2707814e5b38cc15a2795e696 /fs/ocfs2/alloc.c
parent01ffb56bc1cb27f0d9fd50be096446a8d1ab6354 (diff)
ocfs2: clean up some dead code
clean up some unused functions and parameters. Link: http://lkml.kernel.org/r/598A5E21.2080807@huawei.com Signed-off-by: Jun Piao <piaojun@huawei.com> Reviewed-by: Alex Chen <alex.chen@huawei.com> Cc: Mark Fasheh <mfasheh@versity.com> Cc: Joel Becker <jlbec@evilplan.org> Cc: Junxiao Bi <junxiao.bi@oracle.com> Cc: Joseph Qi <jiangqi903@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ocfs2/alloc.c')
-rw-r--r--fs/ocfs2/alloc.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index fb15a96df0b6..a177eae3aa1a 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -955,8 +955,7 @@ int ocfs2_read_extent_block(struct ocfs2_caching_info *ci, u64 eb_blkno,
955/* 955/*
956 * How many free extents have we got before we need more meta data? 956 * How many free extents have we got before we need more meta data?
957 */ 957 */
958int ocfs2_num_free_extents(struct ocfs2_super *osb, 958int ocfs2_num_free_extents(struct ocfs2_extent_tree *et)
959 struct ocfs2_extent_tree *et)
960{ 959{
961 int retval; 960 int retval;
962 struct ocfs2_extent_list *el = NULL; 961 struct ocfs2_extent_list *el = NULL;
@@ -1933,14 +1932,12 @@ out:
1933 * the new changes. 1932 * the new changes.
1934 * 1933 *
1935 * left_rec: the record on the left. 1934 * left_rec: the record on the left.
1936 * left_child_el: is the child list pointed to by left_rec
1937 * right_rec: the record to the right of left_rec 1935 * right_rec: the record to the right of left_rec
1938 * right_child_el: is the child list pointed to by right_rec 1936 * right_child_el: is the child list pointed to by right_rec
1939 * 1937 *
1940 * By definition, this only works on interior nodes. 1938 * By definition, this only works on interior nodes.
1941 */ 1939 */
1942static void ocfs2_adjust_adjacent_records(struct ocfs2_extent_rec *left_rec, 1940static void ocfs2_adjust_adjacent_records(struct ocfs2_extent_rec *left_rec,
1943 struct ocfs2_extent_list *left_child_el,
1944 struct ocfs2_extent_rec *right_rec, 1941 struct ocfs2_extent_rec *right_rec,
1945 struct ocfs2_extent_list *right_child_el) 1942 struct ocfs2_extent_list *right_child_el)
1946{ 1943{
@@ -2003,7 +2000,7 @@ static void ocfs2_adjust_root_records(struct ocfs2_extent_list *root_el,
2003 */ 2000 */
2004 BUG_ON(i >= (le16_to_cpu(root_el->l_next_free_rec) - 1)); 2001 BUG_ON(i >= (le16_to_cpu(root_el->l_next_free_rec) - 1));
2005 2002
2006 ocfs2_adjust_adjacent_records(&root_el->l_recs[i], left_el, 2003 ocfs2_adjust_adjacent_records(&root_el->l_recs[i],
2007 &root_el->l_recs[i + 1], right_el); 2004 &root_el->l_recs[i + 1], right_el);
2008} 2005}
2009 2006
@@ -2060,8 +2057,7 @@ static void ocfs2_complete_edge_insert(handle_t *handle,
2060 el = right_path->p_node[i].el; 2057 el = right_path->p_node[i].el;
2061 right_rec = &el->l_recs[0]; 2058 right_rec = &el->l_recs[0];
2062 2059
2063 ocfs2_adjust_adjacent_records(left_rec, left_el, right_rec, 2060 ocfs2_adjust_adjacent_records(left_rec, right_rec, right_el);
2064 right_el);
2065 2061
2066 ocfs2_journal_dirty(handle, left_path->p_node[i].bh); 2062 ocfs2_journal_dirty(handle, left_path->p_node[i].bh);
2067 ocfs2_journal_dirty(handle, right_path->p_node[i].bh); 2063 ocfs2_journal_dirty(handle, right_path->p_node[i].bh);
@@ -2509,7 +2505,7 @@ out_ret_path:
2509 2505
2510static int ocfs2_update_edge_lengths(handle_t *handle, 2506static int ocfs2_update_edge_lengths(handle_t *handle,
2511 struct ocfs2_extent_tree *et, 2507 struct ocfs2_extent_tree *et,
2512 int subtree_index, struct ocfs2_path *path) 2508 struct ocfs2_path *path)
2513{ 2509{
2514 int i, idx, ret; 2510 int i, idx, ret;
2515 struct ocfs2_extent_rec *rec; 2511 struct ocfs2_extent_rec *rec;
@@ -2755,8 +2751,7 @@ static int ocfs2_rotate_subtree_left(handle_t *handle,
2755 if (del_right_subtree) { 2751 if (del_right_subtree) {
2756 ocfs2_unlink_subtree(handle, et, left_path, right_path, 2752 ocfs2_unlink_subtree(handle, et, left_path, right_path,
2757 subtree_index, dealloc); 2753 subtree_index, dealloc);
2758 ret = ocfs2_update_edge_lengths(handle, et, subtree_index, 2754 ret = ocfs2_update_edge_lengths(handle, et, left_path);
2759 left_path);
2760 if (ret) { 2755 if (ret) {
2761 mlog_errno(ret); 2756 mlog_errno(ret);
2762 goto out; 2757 goto out;
@@ -3060,8 +3055,7 @@ static int ocfs2_remove_rightmost_path(handle_t *handle,
3060 3055
3061 ocfs2_unlink_subtree(handle, et, left_path, path, 3056 ocfs2_unlink_subtree(handle, et, left_path, path,
3062 subtree_index, dealloc); 3057 subtree_index, dealloc);
3063 ret = ocfs2_update_edge_lengths(handle, et, subtree_index, 3058 ret = ocfs2_update_edge_lengths(handle, et, left_path);
3064 left_path);
3065 if (ret) { 3059 if (ret) {
3066 mlog_errno(ret); 3060 mlog_errno(ret);
3067 goto out; 3061 goto out;
@@ -4790,7 +4784,7 @@ int ocfs2_add_clusters_in_btree(handle_t *handle,
4790 if (mark_unwritten) 4784 if (mark_unwritten)
4791 flags = OCFS2_EXT_UNWRITTEN; 4785 flags = OCFS2_EXT_UNWRITTEN;
4792 4786
4793 free_extents = ocfs2_num_free_extents(osb, et); 4787 free_extents = ocfs2_num_free_extents(et);
4794 if (free_extents < 0) { 4788 if (free_extents < 0) {
4795 status = free_extents; 4789 status = free_extents;
4796 mlog_errno(status); 4790 mlog_errno(status);
@@ -5668,7 +5662,7 @@ static int ocfs2_reserve_blocks_for_rec_trunc(struct inode *inode,
5668 5662
5669 *ac = NULL; 5663 *ac = NULL;
5670 5664
5671 num_free_extents = ocfs2_num_free_extents(osb, et); 5665 num_free_extents = ocfs2_num_free_extents(et);
5672 if (num_free_extents < 0) { 5666 if (num_free_extents < 0) {
5673 ret = num_free_extents; 5667 ret = num_free_extents;
5674 mlog_errno(ret); 5668 mlog_errno(ret);