Lines Matching refs:cat

26 static int get_heap_comp_val(struct ubifs_lprops *lprops, int cat)  in get_heap_comp_val()  argument
28 switch (cat) { in get_heap_comp_val()
51 struct ubifs_lprops *lprops, int cat) in move_up_lpt_heap() argument
58 val1 = get_heap_comp_val(lprops, cat); in move_up_lpt_heap()
63 val2 = get_heap_comp_val(heap->arr[ppos], cat); in move_up_lpt_heap()
88 struct ubifs_lprops *lprops, int hpos, int cat) in adjust_lpt_heap() argument
92 val1 = get_heap_comp_val(lprops, cat); in adjust_lpt_heap()
97 val2 = get_heap_comp_val(heap->arr[ppos], cat); in adjust_lpt_heap()
109 val2 = get_heap_comp_val(heap->arr[ppos], cat); in adjust_lpt_heap()
123 val2 = get_heap_comp_val(heap->arr[cpos], cat); in adjust_lpt_heap()
128 cat); in adjust_lpt_heap()
143 val3 = get_heap_comp_val(heap->arr[cpos], cat); in adjust_lpt_heap()
167 int cat) in add_to_lpt_heap() argument
169 struct ubifs_lpt_heap *heap = &c->lpt_heap[cat - 1]; in add_to_lpt_heap()
182 val1 = get_heap_comp_val(lprops, cat); in add_to_lpt_heap()
183 val2 = get_heap_comp_val(heap->arr[cpos], cat); in add_to_lpt_heap()
193 move_up_lpt_heap(c, heap, lprops, cat); in add_to_lpt_heap()
194 dbg_check_heap(c, heap, cat, lprops->hpos); in add_to_lpt_heap()
197 dbg_check_heap(c, heap, cat, -1); in add_to_lpt_heap()
202 move_up_lpt_heap(c, heap, lprops, cat); in add_to_lpt_heap()
203 dbg_check_heap(c, heap, cat, lprops->hpos); in add_to_lpt_heap()
215 struct ubifs_lprops *lprops, int cat) in remove_from_lpt_heap() argument
220 heap = &c->lpt_heap[cat - 1]; in remove_from_lpt_heap()
227 adjust_lpt_heap(c, heap, heap->arr[hpos], hpos, cat); in remove_from_lpt_heap()
229 dbg_check_heap(c, heap, cat, -1); in remove_from_lpt_heap()
244 struct ubifs_lprops *new_lprops, int cat) in lpt_heap_replace() argument
249 heap = &c->lpt_heap[cat - 1]; in lpt_heap_replace()
262 int cat) in ubifs_add_to_cat() argument
264 switch (cat) { in ubifs_add_to_cat()
268 if (add_to_lpt_heap(c, lprops, cat)) in ubifs_add_to_cat()
271 cat = LPROPS_UNCAT; in ubifs_add_to_cat()
291 lprops->flags |= cat; in ubifs_add_to_cat()
305 struct ubifs_lprops *lprops, int cat) in ubifs_remove_from_cat() argument
307 switch (cat) { in ubifs_remove_from_cat()
311 remove_from_lpt_heap(c, lprops, cat); in ubifs_remove_from_cat()
344 int cat; in ubifs_replace_cat() local
346 cat = new_lprops->flags & LPROPS_CAT_MASK; in ubifs_replace_cat()
347 switch (cat) { in ubifs_replace_cat()
351 lpt_heap_replace(c, new_lprops, cat); in ubifs_replace_cat()
375 int cat = lprops->flags & LPROPS_CAT_MASK; in ubifs_ensure_cat() local
377 if (cat != LPROPS_UNCAT) in ubifs_ensure_cat()
379 cat = ubifs_categorize_lprops(c, lprops); in ubifs_ensure_cat()
380 if (cat == LPROPS_UNCAT) in ubifs_ensure_cat()
383 ubifs_add_to_cat(c, lprops, cat); in ubifs_ensure_cat()
855 int i, cat; in dbg_check_cats() local
927 for (cat = 1; cat <= LPROPS_HEAP_CNT; cat++) { in dbg_check_cats()
928 struct ubifs_lpt_heap *heap = &c->lpt_heap[cat - 1]; in dbg_check_cats()
933 ubifs_err(c, "null ptr in LPT heap cat %d", cat); in dbg_check_cats()
937 ubifs_err(c, "bad ptr in LPT heap cat %d", cat); in dbg_check_cats()
941 ubifs_err(c, "taken LEB in LPT heap cat %d", cat); in dbg_check_cats()
950 void dbg_check_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat, in dbg_check_heap() argument
963 if ((lprops->flags & LPROPS_CAT_MASK) != cat) { in dbg_check_heap()
997 ubifs_err(c, "failed cat %d hpos %d err %d", cat, i, err); in dbg_check_heap()
999 ubifs_dump_heap(c, heap, cat); in dbg_check_heap()
1021 int cat, lnum = lp->lnum, is_idx = 0, used = 0, free, dirty, ret; in scan_check_cb() local
1024 cat = lp->flags & LPROPS_CAT_MASK; in scan_check_cb()
1025 if (cat != LPROPS_UNCAT) { in scan_check_cb()
1026 cat = ubifs_categorize_lprops(c, lp); in scan_check_cb()
1027 if (cat != (lp->flags & LPROPS_CAT_MASK)) { in scan_check_cb()
1029 (lp->flags & LPROPS_CAT_MASK), cat); in scan_check_cb()
1038 switch (cat) { in scan_check_cb()
1063 ubifs_err(c, "bad LPT list (category %d)", cat); in scan_check_cb()
1070 if (in_tree && cat > 0 && cat <= LPROPS_HEAP_CNT) { in scan_check_cb()
1071 struct ubifs_lpt_heap *heap = &c->lpt_heap[cat - 1]; in scan_check_cb()
1075 ubifs_err(c, "bad LPT heap (category %d)", cat); in scan_check_cb()