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);
2543 int rc, leafno, ti;
2563 leafno = BLKTOCTLLEAF(blkno, dcp->budmin);
2564 ti = leafno + le32_to_cpu(dcp->leafidx);
2592 rc = dbBackSplit((dmtree_t *)dcp, leafno, true);
2597 dbSplit((dmtree_t *) dcp, leafno, dcp->budmin, newval, true);
2599 rc = dbJoin((dmtree_t *) dcp, leafno, newval, true);
2627 dbJoin((dmtree_t *) dcp, leafno,
2638 dcp, leafno, true);
2639 dbSplit((dmtree_t *) dcp, leafno,
2679 * leafno - the number of the leaf to be updated.
2688 static void dbSplit(dmtree_t *tp, int leafno, int splitsz, int newval, bool is_ctl)
2696 if (leaf[leafno] > tp->dmt_budmin) {
2702 cursz = leaf[leafno] - 1;
2710 dbAdjTree(tp, leafno ^ budsz, cursz, is_ctl);
2722 dbAdjTree(tp, leafno, newval, is_ctl);
2747 * leafno - the number of the leaf to be updated.
2753 static int dbBackSplit(dmtree_t *tp, int leafno, bool is_ctl)
2762 assert(leaf[leafno] == NOFREE);
2772 LITOL2BSZ(leafno, le32_to_cpu(tp->dmt_l2nleafs),
2783 while (leaf[leafno] == NOFREE) {
2786 for (w = leafno, bsz = budsz;; bsz <<= 1,
2810 if (leaf[leafno] != size) {
2827 * leafno - the number of the leaf to be updated.
2832 static int dbJoin(dmtree_t *tp, int leafno, int newval, bool is_ctl)
2846 * the specified leafno with its buddy (leaf) at new value.
2864 buddy = leafno ^ budsz;
2876 /* check which (leafno or buddy) is the left buddy.
2884 if (leafno < buddy) {
2885 /* leafno is the left buddy.
2890 * leafno.
2892 dbAdjTree(tp, leafno, NOFREE, is_ctl);
2893 leafno = buddy;
2905 dbAdjTree(tp, leafno, newval, is_ctl);
2921 * leafno - the number of the leaf to be updated.
2926 static void dbAdjTree(dmtree_t *tp, int leafno, int newval, bool is_ctl)
2933 /* pick up the index of the leaf for this leafno.
2935 lp = leafno + le32_to_cpu(tp->dmt_leafidx);
2954 * group containing the specified leaf (leafno).