Lines Matching refs:cat

38 static int get_heap_comp_val(struct ubifs_lprops *lprops, int cat)  in get_heap_comp_val()  argument
40 switch (cat) { in get_heap_comp_val()
63 struct ubifs_lprops *lprops, int cat) in move_up_lpt_heap() argument
70 val1 = get_heap_comp_val(lprops, cat); in move_up_lpt_heap()
75 val2 = get_heap_comp_val(heap->arr[ppos], cat); in move_up_lpt_heap()
100 struct ubifs_lprops *lprops, int hpos, int cat) in adjust_lpt_heap() argument
104 val1 = get_heap_comp_val(lprops, cat); in adjust_lpt_heap()
109 val2 = get_heap_comp_val(heap->arr[ppos], cat); in adjust_lpt_heap()
121 val2 = get_heap_comp_val(heap->arr[ppos], cat); in adjust_lpt_heap()
135 val2 = get_heap_comp_val(heap->arr[cpos], cat); in adjust_lpt_heap()
140 cat); in adjust_lpt_heap()
155 val3 = get_heap_comp_val(heap->arr[cpos], cat); in adjust_lpt_heap()
179 int cat) in add_to_lpt_heap() argument
181 struct ubifs_lpt_heap *heap = &c->lpt_heap[cat - 1]; in add_to_lpt_heap()
194 val1 = get_heap_comp_val(lprops, cat); in add_to_lpt_heap()
195 val2 = get_heap_comp_val(heap->arr[cpos], cat); in add_to_lpt_heap()
205 move_up_lpt_heap(c, heap, lprops, cat); in add_to_lpt_heap()
206 dbg_check_heap(c, heap, cat, lprops->hpos); in add_to_lpt_heap()
209 dbg_check_heap(c, heap, cat, -1); in add_to_lpt_heap()
214 move_up_lpt_heap(c, heap, lprops, cat); in add_to_lpt_heap()
215 dbg_check_heap(c, heap, cat, lprops->hpos); in add_to_lpt_heap()
227 struct ubifs_lprops *lprops, int cat) in remove_from_lpt_heap() argument
232 heap = &c->lpt_heap[cat - 1]; in remove_from_lpt_heap()
239 adjust_lpt_heap(c, heap, heap->arr[hpos], hpos, cat); in remove_from_lpt_heap()
241 dbg_check_heap(c, heap, cat, -1); in remove_from_lpt_heap()
258 struct ubifs_lprops *new_lprops, int cat) in lpt_heap_replace() argument
263 heap = &c->lpt_heap[cat - 1]; in lpt_heap_replace()
276 int cat) in ubifs_add_to_cat() argument
278 switch (cat) { in ubifs_add_to_cat()
282 if (add_to_lpt_heap(c, lprops, cat)) in ubifs_add_to_cat()
285 cat = LPROPS_UNCAT; in ubifs_add_to_cat()
305 lprops->flags |= cat; in ubifs_add_to_cat()
319 struct ubifs_lprops *lprops, int cat) in ubifs_remove_from_cat() argument
321 switch (cat) { in ubifs_remove_from_cat()
325 remove_from_lpt_heap(c, lprops, cat); in ubifs_remove_from_cat()
358 int cat; in ubifs_replace_cat() local
360 cat = new_lprops->flags & LPROPS_CAT_MASK; in ubifs_replace_cat()
361 switch (cat) { in ubifs_replace_cat()
365 lpt_heap_replace(c, old_lprops, new_lprops, cat); in ubifs_replace_cat()
389 int cat = lprops->flags & LPROPS_CAT_MASK; in ubifs_ensure_cat() local
391 if (cat != LPROPS_UNCAT) in ubifs_ensure_cat()
393 cat = ubifs_categorize_lprops(c, lprops); in ubifs_ensure_cat()
394 if (cat == LPROPS_UNCAT) in ubifs_ensure_cat()
397 ubifs_add_to_cat(c, lprops, cat); in ubifs_ensure_cat()
869 int i, cat; in dbg_check_cats() local
941 for (cat = 1; cat <= LPROPS_HEAP_CNT; cat++) { in dbg_check_cats()
942 struct ubifs_lpt_heap *heap = &c->lpt_heap[cat - 1]; in dbg_check_cats()
947 ubifs_err(c, "null ptr in LPT heap cat %d", cat); in dbg_check_cats()
951 ubifs_err(c, "bad ptr in LPT heap cat %d", cat); in dbg_check_cats()
955 ubifs_err(c, "taken LEB in LPT heap cat %d", cat); in dbg_check_cats()
964 void dbg_check_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat, in dbg_check_heap() argument
977 if ((lprops->flags & LPROPS_CAT_MASK) != cat) { in dbg_check_heap()
1011 ubifs_err(c, "failed cat %d hpos %d err %d", cat, i, err); in dbg_check_heap()
1013 ubifs_dump_heap(c, heap, cat); in dbg_check_heap()
1035 int cat, lnum = lp->lnum, is_idx = 0, used = 0, free, dirty, ret; in scan_check_cb() local
1038 cat = lp->flags & LPROPS_CAT_MASK; in scan_check_cb()
1039 if (cat != LPROPS_UNCAT) { in scan_check_cb()
1040 cat = ubifs_categorize_lprops(c, lp); in scan_check_cb()
1041 if (cat != (lp->flags & LPROPS_CAT_MASK)) { in scan_check_cb()
1043 (lp->flags & LPROPS_CAT_MASK), cat); in scan_check_cb()
1052 switch (cat) { in scan_check_cb()
1077 ubifs_err(c, "bad LPT list (category %d)", cat); in scan_check_cb()
1084 if (in_tree && cat > 0 && cat <= LPROPS_HEAP_CNT) { in scan_check_cb()
1085 struct ubifs_lpt_heap *heap = &c->lpt_heap[cat - 1]; in scan_check_cb()
1089 ubifs_err(c, "bad LPT heap (category %d)", cat); in scan_check_cb()