Lines Matching refs:cat
30 static int get_heap_comp_val(struct ubifs_lprops *lprops, int cat) in get_heap_comp_val() argument
32 switch (cat) { in get_heap_comp_val()
55 struct ubifs_lprops *lprops, int cat) in move_up_lpt_heap() argument
62 val1 = get_heap_comp_val(lprops, cat); in move_up_lpt_heap()
67 val2 = get_heap_comp_val(heap->arr[ppos], cat); in move_up_lpt_heap()
92 struct ubifs_lprops *lprops, int hpos, int cat) in adjust_lpt_heap() argument
96 val1 = get_heap_comp_val(lprops, cat); in adjust_lpt_heap()
101 val2 = get_heap_comp_val(heap->arr[ppos], cat); in adjust_lpt_heap()
113 val2 = get_heap_comp_val(heap->arr[ppos], cat); in adjust_lpt_heap()
127 val2 = get_heap_comp_val(heap->arr[cpos], cat); in adjust_lpt_heap()
132 cat); in adjust_lpt_heap()
147 val3 = get_heap_comp_val(heap->arr[cpos], cat); in adjust_lpt_heap()
171 int cat) in add_to_lpt_heap() argument
173 struct ubifs_lpt_heap *heap = &c->lpt_heap[cat - 1]; in add_to_lpt_heap()
186 val1 = get_heap_comp_val(lprops, cat); in add_to_lpt_heap()
187 val2 = get_heap_comp_val(heap->arr[cpos], cat); in add_to_lpt_heap()
197 move_up_lpt_heap(c, heap, lprops, cat); in add_to_lpt_heap()
198 dbg_check_heap(c, heap, cat, lprops->hpos); in add_to_lpt_heap()
201 dbg_check_heap(c, heap, cat, -1); in add_to_lpt_heap()
206 move_up_lpt_heap(c, heap, lprops, cat); in add_to_lpt_heap()
207 dbg_check_heap(c, heap, cat, lprops->hpos); in add_to_lpt_heap()
219 struct ubifs_lprops *lprops, int cat) in remove_from_lpt_heap() argument
224 heap = &c->lpt_heap[cat - 1]; in remove_from_lpt_heap()
231 adjust_lpt_heap(c, heap, heap->arr[hpos], hpos, cat); in remove_from_lpt_heap()
233 dbg_check_heap(c, heap, cat, -1); in remove_from_lpt_heap()
250 struct ubifs_lprops *new_lprops, int cat) in lpt_heap_replace() argument
255 heap = &c->lpt_heap[cat - 1]; in lpt_heap_replace()
268 int cat) in ubifs_add_to_cat() argument
270 switch (cat) { in ubifs_add_to_cat()
274 if (add_to_lpt_heap(c, lprops, cat)) in ubifs_add_to_cat()
277 cat = LPROPS_UNCAT; in ubifs_add_to_cat()
297 lprops->flags |= cat; in ubifs_add_to_cat()
311 struct ubifs_lprops *lprops, int cat) in ubifs_remove_from_cat() argument
313 switch (cat) { in ubifs_remove_from_cat()
317 remove_from_lpt_heap(c, lprops, cat); in ubifs_remove_from_cat()
350 int cat; in ubifs_replace_cat() local
352 cat = new_lprops->flags & LPROPS_CAT_MASK; in ubifs_replace_cat()
353 switch (cat) { in ubifs_replace_cat()
357 lpt_heap_replace(c, old_lprops, new_lprops, cat); in ubifs_replace_cat()
381 int cat = lprops->flags & LPROPS_CAT_MASK; in ubifs_ensure_cat() local
383 if (cat != LPROPS_UNCAT) in ubifs_ensure_cat()
385 cat = ubifs_categorize_lprops(c, lprops); in ubifs_ensure_cat()
386 if (cat == LPROPS_UNCAT) in ubifs_ensure_cat()
389 ubifs_add_to_cat(c, lprops, cat); in ubifs_ensure_cat()
861 int i, cat; in dbg_check_cats() local
933 for (cat = 1; cat <= LPROPS_HEAP_CNT; cat++) { in dbg_check_cats()
934 struct ubifs_lpt_heap *heap = &c->lpt_heap[cat - 1]; in dbg_check_cats()
939 ubifs_err(c, "null ptr in LPT heap cat %d", cat); in dbg_check_cats()
943 ubifs_err(c, "bad ptr in LPT heap cat %d", cat); in dbg_check_cats()
947 ubifs_err(c, "taken LEB in LPT heap cat %d", cat); in dbg_check_cats()
956 void dbg_check_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat, in dbg_check_heap() argument
969 if ((lprops->flags & LPROPS_CAT_MASK) != cat) { in dbg_check_heap()
1003 ubifs_err(c, "failed cat %d hpos %d err %d", cat, i, err); in dbg_check_heap()
1005 ubifs_dump_heap(c, heap, cat); in dbg_check_heap()
1027 int cat, lnum = lp->lnum, is_idx = 0, used = 0, free, dirty, ret; in scan_check_cb() local
1030 cat = lp->flags & LPROPS_CAT_MASK; in scan_check_cb()
1031 if (cat != LPROPS_UNCAT) { in scan_check_cb()
1032 cat = ubifs_categorize_lprops(c, lp); in scan_check_cb()
1033 if (cat != (lp->flags & LPROPS_CAT_MASK)) { in scan_check_cb()
1035 (lp->flags & LPROPS_CAT_MASK), cat); in scan_check_cb()
1044 switch (cat) { in scan_check_cb()
1069 ubifs_err(c, "bad LPT list (category %d)", cat); in scan_check_cb()
1076 if (in_tree && cat > 0 && cat <= LPROPS_HEAP_CNT) { in scan_check_cb()
1077 struct ubifs_lpt_heap *heap = &c->lpt_heap[cat - 1]; in scan_check_cb()
1081 ubifs_err(c, "bad LPT heap (category %d)", cat); in scan_check_cb()