fix_node.c (05668381140309088443bf5dc53add4104610fbb) | fix_node.c (fec6d055da71fb02a76f9c2c12427fa79974018b) |
---|---|
1/* 2 * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README 3 */ 4 5/** 6 ** old_item_num 7 ** old_entry_num 8 ** set_entry_sizes --- 943 unchanged lines hidden (view full) --- 952 */ 953static int get_far_parent(struct tree_balance *p_s_tb, 954 int n_h, 955 struct buffer_head **pp_s_father, 956 struct buffer_head **pp_s_com_father, char c_lr_par) 957{ 958 struct buffer_head *p_s_parent; 959 INITIALIZE_PATH(s_path_to_neighbor_father); | 1/* 2 * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README 3 */ 4 5/** 6 ** old_item_num 7 ** old_entry_num 8 ** set_entry_sizes --- 943 unchanged lines hidden (view full) --- 952 */ 953static int get_far_parent(struct tree_balance *p_s_tb, 954 int n_h, 955 struct buffer_head **pp_s_father, 956 struct buffer_head **pp_s_com_father, char c_lr_par) 957{ 958 struct buffer_head *p_s_parent; 959 INITIALIZE_PATH(s_path_to_neighbor_father); |
960 struct path *p_s_path = p_s_tb->tb_path; | 960 struct treepath *p_s_path = p_s_tb->tb_path; |
961 struct cpu_key s_lr_father_key; 962 int n_counter, 963 n_position = INT_MAX, 964 n_first_last_position = 0, 965 n_path_offset = PATH_H_PATH_OFFSET(p_s_path, n_h); 966 967 /* Starting from F[n_h] go upwards in the tree, and look for the common 968 ancestor of F[n_h], and its neighbor l/r, that should be obtained. */ --- 100 unchanged lines hidden (view full) --- 1069 * S[n_path_offset] and L[n_path_offset]/R[n_path_offset]: F[n_path_offset], FL[n_path_offset], 1070 * FR[n_path_offset], CFL[n_path_offset], CFR[n_path_offset]. 1071 * Calculate numbers of left and right delimiting keys position: lkey[n_path_offset], rkey[n_path_offset]. 1072 * Returns: SCHEDULE_OCCURRED - schedule occurred while the function worked; 1073 * CARRY_ON - schedule didn't occur while the function worked; 1074 */ 1075static int get_parents(struct tree_balance *p_s_tb, int n_h) 1076{ | 961 struct cpu_key s_lr_father_key; 962 int n_counter, 963 n_position = INT_MAX, 964 n_first_last_position = 0, 965 n_path_offset = PATH_H_PATH_OFFSET(p_s_path, n_h); 966 967 /* Starting from F[n_h] go upwards in the tree, and look for the common 968 ancestor of F[n_h], and its neighbor l/r, that should be obtained. */ --- 100 unchanged lines hidden (view full) --- 1069 * S[n_path_offset] and L[n_path_offset]/R[n_path_offset]: F[n_path_offset], FL[n_path_offset], 1070 * FR[n_path_offset], CFL[n_path_offset], CFR[n_path_offset]. 1071 * Calculate numbers of left and right delimiting keys position: lkey[n_path_offset], rkey[n_path_offset]. 1072 * Returns: SCHEDULE_OCCURRED - schedule occurred while the function worked; 1073 * CARRY_ON - schedule didn't occur while the function worked; 1074 */ 1075static int get_parents(struct tree_balance *p_s_tb, int n_h) 1076{ |
1077 struct path *p_s_path = p_s_tb->tb_path; | 1077 struct treepath *p_s_path = p_s_tb->tb_path; |
1078 int n_position, 1079 n_ret_value, 1080 n_path_offset = PATH_H_PATH_OFFSET(p_s_tb->tb_path, n_h); 1081 struct buffer_head *p_s_curf, *p_s_curcf; 1082 1083 /* Current node is the root of the tree or will be root of the tree */ 1084 if (n_path_offset <= FIRST_PATH_ELEMENT_OFFSET) { 1085 /* The root can not have parents. --- 794 unchanged lines hidden (view full) --- 1880 /* Calculate balance parameters when size of node is decreasing. */ 1881 return dc_check_balance(tb, h); 1882} 1883 1884/* Check whether parent at the path is the really parent of the current node.*/ 1885static int get_direct_parent(struct tree_balance *p_s_tb, int n_h) 1886{ 1887 struct buffer_head *p_s_bh; | 1078 int n_position, 1079 n_ret_value, 1080 n_path_offset = PATH_H_PATH_OFFSET(p_s_tb->tb_path, n_h); 1081 struct buffer_head *p_s_curf, *p_s_curcf; 1082 1083 /* Current node is the root of the tree or will be root of the tree */ 1084 if (n_path_offset <= FIRST_PATH_ELEMENT_OFFSET) { 1085 /* The root can not have parents. --- 794 unchanged lines hidden (view full) --- 1880 /* Calculate balance parameters when size of node is decreasing. */ 1881 return dc_check_balance(tb, h); 1882} 1883 1884/* Check whether parent at the path is the really parent of the current node.*/ 1885static int get_direct_parent(struct tree_balance *p_s_tb, int n_h) 1886{ 1887 struct buffer_head *p_s_bh; |
1888 struct path *p_s_path = p_s_tb->tb_path; | 1888 struct treepath *p_s_path = p_s_tb->tb_path; |
1889 int n_position, 1890 n_path_offset = PATH_H_PATH_OFFSET(p_s_tb->tb_path, n_h); 1891 1892 /* We are in the root or in the new root. */ 1893 if (n_path_offset <= FIRST_PATH_ELEMENT_OFFSET) { 1894 1895 RFALSE(n_path_offset < FIRST_PATH_ELEMENT_OFFSET - 1, 1896 "PAP-8260: invalid offset in the path"); --- 684 unchanged lines hidden --- | 1889 int n_position, 1890 n_path_offset = PATH_H_PATH_OFFSET(p_s_tb->tb_path, n_h); 1891 1892 /* We are in the root or in the new root. */ 1893 if (n_path_offset <= FIRST_PATH_ELEMENT_OFFSET) { 1894 1895 RFALSE(n_path_offset < FIRST_PATH_ELEMENT_OFFSET - 1, 1896 "PAP-8260: invalid offset in the path"); --- 684 unchanged lines hidden --- |