Lines Matching refs:leafno
66 static void dbSplit(dmtree_t *tp, int leafno, int splitsz, int newval, bool is_ctl);
67 static int dbBackSplit(dmtree_t *tp, int leafno, bool is_ctl);
68 static int dbJoin(dmtree_t *tp, int leafno, int newval, bool is_ctl);
69 static void dbAdjTree(dmtree_t *tp, int leafno, int newval, bool is_ctl);
2475 int rc, leafno, ti;
2495 leafno = BLKTOCTLLEAF(blkno, dcp->budmin);
2496 ti = leafno + le32_to_cpu(dcp->leafidx);
2524 rc = dbBackSplit((dmtree_t *)dcp, leafno, true);
2531 dbSplit((dmtree_t *) dcp, leafno, dcp->budmin, newval, true);
2533 rc = dbJoin((dmtree_t *) dcp, leafno, newval, true);
2563 dbJoin((dmtree_t *) dcp, leafno,
2574 dcp, leafno, true);
2575 dbSplit((dmtree_t *) dcp, leafno,
2615 * leafno - the number of the leaf to be updated.
2624 static void dbSplit(dmtree_t *tp, int leafno, int splitsz, int newval, bool is_ctl)
2632 if (leaf[leafno] > tp->dmt_budmin) {
2638 cursz = leaf[leafno] - 1;
2646 dbAdjTree(tp, leafno ^ budsz, cursz, is_ctl);
2658 dbAdjTree(tp, leafno, newval, is_ctl);
2683 * leafno - the number of the leaf to be updated.
2689 static int dbBackSplit(dmtree_t *tp, int leafno, bool is_ctl)
2698 assert(leaf[leafno] == NOFREE);
2708 LITOL2BSZ(leafno, le32_to_cpu(tp->dmt_l2nleafs),
2719 while (leaf[leafno] == NOFREE) {
2722 for (w = leafno, bsz = budsz;; bsz <<= 1,
2746 if (leaf[leafno] != size) {
2763 * leafno - the number of the leaf to be updated.
2768 static int dbJoin(dmtree_t *tp, int leafno, int newval, bool is_ctl)
2782 * the specified leafno with its buddy (leaf) at new value.
2800 buddy = leafno ^ budsz;
2812 /* check which (leafno or buddy) is the left buddy.
2820 if (leafno < buddy) {
2821 /* leafno is the left buddy.
2826 * leafno.
2828 dbAdjTree(tp, leafno, NOFREE, is_ctl);
2829 leafno = buddy;
2841 dbAdjTree(tp, leafno, newval, is_ctl);
2857 * leafno - the number of the leaf to be updated.
2862 static void dbAdjTree(dmtree_t *tp, int leafno, int newval, bool is_ctl)
2869 /* pick up the index of the leaf for this leafno.
2871 lp = leafno + le32_to_cpu(tp->dmt_leafidx);
2890 * group containing the specified leaf (leafno).