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