Lines Matching refs:cpos
94 int val1, val2, val3, cpos; in adjust_lpt_heap() local
124 cpos = hpos * 2 + 1; in adjust_lpt_heap()
125 if (cpos >= heap->cnt) in adjust_lpt_heap()
127 val2 = get_heap_comp_val(heap->arr[cpos], cat); in adjust_lpt_heap()
130 if (cpos + 1 < heap->cnt) { in adjust_lpt_heap()
131 val3 = get_heap_comp_val(heap->arr[cpos + 1], in adjust_lpt_heap()
134 cpos += 1; /* Right child is bigger */ in adjust_lpt_heap()
136 heap->arr[cpos]->hpos = hpos; in adjust_lpt_heap()
137 heap->arr[hpos] = heap->arr[cpos]; in adjust_lpt_heap()
138 heap->arr[cpos] = lprops; in adjust_lpt_heap()
139 lprops->hpos = cpos; in adjust_lpt_heap()
140 hpos = cpos; in adjust_lpt_heap()
144 cpos += 1; in adjust_lpt_heap()
145 if (cpos >= heap->cnt) in adjust_lpt_heap()
147 val3 = get_heap_comp_val(heap->arr[cpos], cat); in adjust_lpt_heap()
150 heap->arr[cpos]->hpos = hpos; in adjust_lpt_heap()
151 heap->arr[hpos] = heap->arr[cpos]; in adjust_lpt_heap()
152 heap->arr[cpos] = lprops; in adjust_lpt_heap()
153 lprops->hpos = cpos; in adjust_lpt_heap()
154 hpos = cpos; in adjust_lpt_heap()
177 int cpos, val1, val2; in add_to_lpt_heap() local
181 cpos = (((size_t)lprops >> 4) & b) + b; in add_to_lpt_heap()
182 ubifs_assert(cpos >= b); in add_to_lpt_heap()
183 ubifs_assert(cpos < LPT_HEAP_SZ); in add_to_lpt_heap()
184 ubifs_assert(cpos < heap->cnt); in add_to_lpt_heap()
187 val2 = get_heap_comp_val(heap->arr[cpos], cat); in add_to_lpt_heap()
191 lp = heap->arr[cpos]; in add_to_lpt_heap()
195 lprops->hpos = cpos; in add_to_lpt_heap()
196 heap->arr[cpos] = lprops; in add_to_lpt_heap()