Lines Matching refs:cpos
90 int val1, val2, val3, cpos; in adjust_lpt_heap() local
120 cpos = hpos * 2 + 1; in adjust_lpt_heap()
121 if (cpos >= heap->cnt) in adjust_lpt_heap()
123 val2 = get_heap_comp_val(heap->arr[cpos], cat); in adjust_lpt_heap()
126 if (cpos + 1 < heap->cnt) { in adjust_lpt_heap()
127 val3 = get_heap_comp_val(heap->arr[cpos + 1], in adjust_lpt_heap()
130 cpos += 1; /* Right child is bigger */ in adjust_lpt_heap()
132 heap->arr[cpos]->hpos = hpos; in adjust_lpt_heap()
133 heap->arr[hpos] = heap->arr[cpos]; in adjust_lpt_heap()
134 heap->arr[cpos] = lprops; in adjust_lpt_heap()
135 lprops->hpos = cpos; in adjust_lpt_heap()
136 hpos = cpos; in adjust_lpt_heap()
140 cpos += 1; in adjust_lpt_heap()
141 if (cpos >= heap->cnt) in adjust_lpt_heap()
143 val3 = get_heap_comp_val(heap->arr[cpos], cat); in adjust_lpt_heap()
146 heap->arr[cpos]->hpos = hpos; in adjust_lpt_heap()
147 heap->arr[hpos] = heap->arr[cpos]; in adjust_lpt_heap()
148 heap->arr[cpos] = lprops; in adjust_lpt_heap()
149 lprops->hpos = cpos; in adjust_lpt_heap()
150 hpos = cpos; in adjust_lpt_heap()
173 int cpos, val1, val2; in add_to_lpt_heap() local
177 cpos = (((size_t)lprops >> 4) & b) + b; in add_to_lpt_heap()
178 ubifs_assert(c, cpos >= b); in add_to_lpt_heap()
179 ubifs_assert(c, cpos < LPT_HEAP_SZ); in add_to_lpt_heap()
180 ubifs_assert(c, cpos < heap->cnt); in add_to_lpt_heap()
183 val2 = get_heap_comp_val(heap->arr[cpos], cat); in add_to_lpt_heap()
187 lp = heap->arr[cpos]; in add_to_lpt_heap()
191 lprops->hpos = cpos; in add_to_lpt_heap()
192 heap->arr[cpos] = lprops; in add_to_lpt_heap()