Lines Matching refs:cpos
95 int val1, val2, val3, cpos; in adjust_lpt_heap() local
125 cpos = hpos * 2 + 1; in adjust_lpt_heap()
126 if (cpos >= heap->cnt) in adjust_lpt_heap()
128 val2 = get_heap_comp_val(heap->arr[cpos], cat); in adjust_lpt_heap()
131 if (cpos + 1 < heap->cnt) { in adjust_lpt_heap()
132 val3 = get_heap_comp_val(heap->arr[cpos + 1], in adjust_lpt_heap()
135 cpos += 1; /* Right child is bigger */ in adjust_lpt_heap()
137 heap->arr[cpos]->hpos = hpos; in adjust_lpt_heap()
138 heap->arr[hpos] = heap->arr[cpos]; in adjust_lpt_heap()
139 heap->arr[cpos] = lprops; in adjust_lpt_heap()
140 lprops->hpos = cpos; in adjust_lpt_heap()
141 hpos = cpos; in adjust_lpt_heap()
145 cpos += 1; in adjust_lpt_heap()
146 if (cpos >= heap->cnt) in adjust_lpt_heap()
148 val3 = get_heap_comp_val(heap->arr[cpos], cat); in adjust_lpt_heap()
151 heap->arr[cpos]->hpos = hpos; in adjust_lpt_heap()
152 heap->arr[hpos] = heap->arr[cpos]; in adjust_lpt_heap()
153 heap->arr[cpos] = lprops; in adjust_lpt_heap()
154 lprops->hpos = cpos; in adjust_lpt_heap()
155 hpos = cpos; in adjust_lpt_heap()
178 int cpos, val1, val2; in add_to_lpt_heap() local
182 cpos = (((size_t)lprops >> 4) & b) + b; in add_to_lpt_heap()
183 ubifs_assert(cpos >= b); in add_to_lpt_heap()
184 ubifs_assert(cpos < LPT_HEAP_SZ); in add_to_lpt_heap()
185 ubifs_assert(cpos < heap->cnt); in add_to_lpt_heap()
188 val2 = get_heap_comp_val(heap->arr[cpos], cat); in add_to_lpt_heap()
192 lp = heap->arr[cpos]; in add_to_lpt_heap()
196 lprops->hpos = cpos; in add_to_lpt_heap()
197 heap->arr[cpos] = lprops; in add_to_lpt_heap()