• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/fs/ubifs/

Lines Matching defs:lprops

35  * @lprops: LEB properties
38 static int get_heap_comp_val(struct ubifs_lprops *lprops, int cat)
42 return lprops->free;
44 return lprops->free + lprops->dirty;
46 return lprops->dirty;
54 * @lprops: LEB properties to move
63 struct ubifs_lprops *lprops, int cat)
67 hpos = lprops->hpos;
70 val1 = get_heap_comp_val(lprops, cat);
81 heap->arr[ppos] = lprops;
82 lprops->hpos = ppos;
91 * @lprops: LEB properties to move
92 * @hpos: heap position of @lprops
100 struct ubifs_lprops *lprops, int hpos, int cat)
104 val1 = get_heap_comp_val(lprops, cat);
115 heap->arr[ppos] = lprops;
116 lprops->hpos = ppos;
146 heap->arr[cpos] = lprops;
147 lprops->hpos = cpos;
160 heap->arr[cpos] = lprops;
161 lprops->hpos = cpos;
172 * @lprops: LEB properties to add
175 * This function returns %1 if @lprops is added to the heap for LEB category
178 static int add_to_lpt_heap(struct ubifs_info *c, struct ubifs_lprops *lprops,
189 cpos = (((size_t)lprops >> 4) & b) + b;
194 val1 = get_heap_comp_val(lprops, cat);
203 lprops->hpos = cpos;
204 heap->arr[cpos] = lprops;
205 move_up_lpt_heap(c, heap, lprops, cat);
206 dbg_check_heap(c, heap, cat, lprops->hpos);
212 lprops->hpos = heap->cnt++;
213 heap->arr[lprops->hpos] = lprops;
214 move_up_lpt_heap(c, heap, lprops, cat);
215 dbg_check_heap(c, heap, cat, lprops->hpos);
223 * @lprops: LEB properties to remove
227 struct ubifs_lprops *lprops, int cat)
230 int hpos = lprops->hpos;
234 ubifs_assert(heap->arr[hpos] == lprops);
245 * lpt_heap_replace - replace lprops in a category heap.
252 * and the lprops that the pnode contains. When that happens, references in
253 * the category heaps to those lprops must be updated to point to the new
254 * lprops. This function does that.
270 * @lprops: LEB properties to add
275 void ubifs_add_to_cat(struct ubifs_info *c, struct ubifs_lprops *lprops,
282 if (add_to_lpt_heap(c, lprops, cat))
288 list_add(&lprops->list, &c->uncat_list);
291 list_add(&lprops->list, &c->empty_list);
294 list_add(&lprops->list, &c->freeable_list);
298 list_add(&lprops->list, &c->frdi_idx_list);
303 lprops->flags &= ~LPROPS_CAT_MASK;
304 lprops->flags |= cat;
310 * @lprops: LEB properties to remove
316 struct ubifs_lprops *lprops, int cat)
322 remove_from_lpt_heap(c, lprops, cat);
331 ubifs_assert(!list_empty(&lprops->list));
332 list_del(&lprops->list);
340 * ubifs_replace_cat - replace lprops in a category list or heap.
346 * and the lprops that the pnode contains. When that happens, references in
375 * @lprops: LEB properties
381 void ubifs_ensure_cat(struct ubifs_info *c, struct ubifs_lprops *lprops)
383 int cat = lprops->flags & LPROPS_CAT_MASK;
387 cat = ubifs_categorize_lprops(c, lprops);
390 ubifs_remove_from_cat(c, lprops, LPROPS_UNCAT);
391 ubifs_add_to_cat(c, lprops, cat);
397 * @lprops: LEB properties to categorize
405 const struct ubifs_lprops *lprops)
407 if (lprops->flags & LPROPS_TAKEN)
410 if (lprops->free == c->leb_size) {
411 ubifs_assert(!(lprops->flags & LPROPS_INDEX));
415 if (lprops->free + lprops->dirty == c->leb_size) {
416 if (lprops->flags & LPROPS_INDEX)
422 if (lprops->flags & LPROPS_INDEX) {
423 if (lprops->dirty + lprops->free >= c->min_idx_node_sz)
426 if (lprops->dirty >= c->dead_wm &&
427 lprops->dirty > lprops->free)
429 if (lprops->free > 0)
439 * @lprops: LEB properties to re-categorize
444 static void change_category(struct ubifs_info *c, struct ubifs_lprops *lprops)
446 int old_cat = lprops->flags & LPROPS_CAT_MASK;
447 int new_cat = ubifs_categorize_lprops(c, lprops);
452 /* lprops on a heap now must be moved up or down */
456 adjust_lpt_heap(c, heap, lprops, lprops->hpos, new_cat);
458 ubifs_remove_from_cat(c, lprops, old_cat);
459 ubifs_add_to_cat(c, lprops, new_cat);
496 * @lprops: LEB properties to test
498 static int is_lprops_dirty(struct ubifs_info *c, struct ubifs_lprops *lprops)
503 pos = (lprops->lnum - c->main_first) & (UBIFS_LPT_FANOUT - 1);
504 pnode = (struct ubifs_pnode *)container_of(lprops - pos,
506 lprops[0]);
534 * This is the only function that is allowed to change lprops, so we
537 struct ubifs_lprops *lprops = (struct ubifs_lprops *)lp;
540 lprops->lnum, free, dirty, flags);
555 if (!is_lprops_dirty(c, lprops)) {
556 lprops = ubifs_lpt_lookup_dirty(c, lprops->lnum);
557 if (IS_ERR(lprops))
558 return lprops;
560 ubifs_assert(lprops == ubifs_lpt_lookup_dirty(c, lprops->lnum));
562 ubifs_assert(!(lprops->free & 7) && !(lprops->dirty & 7));
565 if ((lprops->flags & LPROPS_TAKEN) && lprops->free == c->leb_size)
568 if (!(lprops->flags & LPROPS_INDEX)) {
571 old_spc = lprops->free + lprops->dirty;
582 c->lst.total_free += free - lprops->free;
586 if (lprops->free != c->leb_size)
588 } else if (lprops->free == c->leb_size)
590 lprops->free = free;
595 c->lst.total_dirty += dirty - lprops->dirty;
596 lprops->dirty = dirty;
601 if ((lprops->flags & LPROPS_INDEX)) {
606 lprops->flags = flags;
609 if (!(lprops->flags & LPROPS_INDEX)) {
612 new_spc = lprops->free + lprops->dirty;
621 if ((lprops->flags & LPROPS_TAKEN) && lprops->free == c->leb_size)
624 change_category(c, lprops);
627 return lprops;
631 * ubifs_get_lp_stats - get lprops statistics.
653 * 'ubifs_change_lp()' which hides lprops get/release. The arguments are the
764 struct ubifs_lprops *lprops;
773 lprops = heap->arr[0];
774 ubifs_assert(!(lprops->flags & LPROPS_TAKEN));
775 ubifs_assert(!(lprops->flags & LPROPS_INDEX));
776 return lprops;
788 struct ubifs_lprops *lprops;
795 lprops = list_entry(c->empty_list.next, struct ubifs_lprops, list);
796 ubifs_assert(!(lprops->flags & LPROPS_TAKEN));
797 ubifs_assert(!(lprops->flags & LPROPS_INDEX));
798 ubifs_assert(lprops->free == c->leb_size);
799 return lprops;
811 struct ubifs_lprops *lprops;
818 lprops = list_entry(c->freeable_list.next, struct ubifs_lprops, list);
819 ubifs_assert(!(lprops->flags & LPROPS_TAKEN));
820 ubifs_assert(!(lprops->flags & LPROPS_INDEX));
821 ubifs_assert(lprops->free + lprops->dirty == c->leb_size);
823 return lprops;
835 struct ubifs_lprops *lprops;
842 lprops = list_entry(c->frdi_idx_list.next, struct ubifs_lprops, list);
843 ubifs_assert(!(lprops->flags & LPROPS_TAKEN));
844 ubifs_assert((lprops->flags & LPROPS_INDEX));
845 ubifs_assert(lprops->free + lprops->dirty == c->leb_size);
846 return lprops;
859 struct ubifs_lprops *lprops;
866 list_for_each_entry(lprops, &c->empty_list, list) {
867 if (lprops->free != c->leb_size) {
869 "(free %d dirty %d flags %d)", lprops->lnum,
870 lprops->free, lprops->dirty, lprops->flags);
873 if (lprops->flags & LPROPS_TAKEN) {
875 "(free %d dirty %d flags %d)", lprops->lnum,
876 lprops->free, lprops->dirty, lprops->flags);
882 list_for_each_entry(lprops, &c->freeable_list, list) {
883 if (lprops->free + lprops->dirty != c->leb_size) {
885 "(free %d dirty %d flags %d)", lprops->lnum,
886 lprops->free, lprops->dirty, lprops->flags);
889 if (lprops->flags & LPROPS_TAKEN) {
891 "(free %d dirty %d flags %d)", lprops->lnum,
892 lprops->free, lprops->dirty, lprops->flags);
912 list_for_each_entry(lprops, &c->frdi_idx_list, list) {
913 if (lprops->free + lprops->dirty != c->leb_size) {
915 "(free %d dirty %d flags %d)", lprops->lnum,
916 lprops->free, lprops->dirty, lprops->flags);
919 if (lprops->flags & LPROPS_TAKEN) {
921 "(free %d dirty %d flags %d)", lprops->lnum,
922 lprops->free, lprops->dirty, lprops->flags);
925 if (!(lprops->flags & LPROPS_INDEX)) {
927 "(free %d dirty %d flags %d)", lprops->lnum,
928 lprops->free, lprops->dirty, lprops->flags);
937 lprops = heap->arr[i];
938 if (!lprops) {
942 if (lprops->hpos != i) {
946 if (lprops->flags & LPROPS_TAKEN) {
965 struct ubifs_lprops *lprops = heap->arr[i];
969 if ((lprops->flags & LPROPS_CAT_MASK) != cat) {
973 if (lprops->hpos != i) {
977 lp = ubifs_lpt_lookup(c, lprops->lnum);
982 if (lprops != lp) {
983 dbg_msg("lprops %zx lp %zx lprops->lnum %d lp->lnum %d",
984 (size_t)lprops, (size_t)lp, lprops->lnum,
991 if (lp == lprops) {
995 if (lp->lnum == lprops->lnum) {
1069 struct ubifs_lprops *lprops;
1072 list_for_each_entry(lprops, list, list) {
1073 if (lprops == lp) {
1186 * amount of free space than the value recorded by lprops. That
1306 ubifs_err("read from lprops: empty_lebs %d, idx_lebs %d, "
1319 ubifs_err("read from lprops: total_dead %lld, total_dark %lld",