Lines Matching refs:header
132 if (((P)->header.nextindex > (((BN)==0)?DTROOTMAXSLOT:(P)->header.maxslot)) ||\
133 ((BN) && ((P)->header.maxslot > DTPAGEMAXSLOT)))\
645 for (base = 0, lim = p->header.nextindex; lim; lim >>= 1) {
648 if (p->header.flag & BT_LEAF) {
667 if (p->header.flag & BT_LEAF) {
737 if (p->header.flag & BT_LEAF) {
869 if (n > p->header.freecnt) {
893 /* linelock header */
901 if (!(p->header.flag & BT_ROOT)) {
906 lv->offset = p->header.stblindex + n;
908 ((p->header.nextindex - 1) >> L2DTSLOTSIZE) - n + 1;
976 if (sp->header.flag & BT_ROOT) {
983 n -= DTROOTMAXSLOT - sp->header.freecnt; /* header + entries */
1018 pxd = &sp->header.self;
1025 if ((n + sp->header.freecnt) <= split->nslot)
1176 switch (rp->header.flag & BT_TYPE) {
1183 if ((sp->header.flag & BT_ROOT && skip > 1) ||
1184 sp->header.prev != 0 || skip > 1) {
1187 lp->header.nextindex-1,
1232 if (n > sp->header.freecnt) {
1247 rc = (sp->header.flag & BT_ROOT) ?
1270 /* linelock header */
1276 if (!(sp->header.flag & BT_ROOT)) {
1279 lv->offset = sp->header.stblindex + n;
1281 ((sp->header.nextindex -
1389 rp->header.self = *pxd;
1400 /* linelock header of split page */
1410 nextbn = le64_to_cpu(sp->header.next);
1411 rp->header.next = cpu_to_le64(nextbn);
1412 rp->header.prev = cpu_to_le64(addressPXD(&sp->header.self));
1413 sp->header.next = cpu_to_le64(rbn);
1418 rp->header.flag = sp->header.flag;
1421 rp->header.nextindex = 0;
1422 rp->header.stblindex = 1;
1425 rp->header.maxslot = n;
1429 fsi = rp->header.stblindex + stblsize;
1430 rp->header.freelist = fsi;
1431 rp->header.freecnt = rp->header.maxslot - fsi;
1446 if (nextbn == 0 && split->index == sp->header.nextindex) {
1447 /* linelock header + stbl (first slot) of new page */
1457 for (fsi++; fsi < rp->header.maxslot; f++, fsi++)
1490 /* linelock header of previous right sibling page */
1496 p->header.prev = cpu_to_le64(rbn);
1514 stbl = (u8 *) & sp->slot[sp->header.stblindex];
1515 nextindex = sp->header.nextindex;
1522 switch (sp->header.flag & BT_TYPE) {
1559 /* linelock header + stbl of new right page */
1567 sp->header.nextindex = nxt;
1572 fsi = rp->header.freelist;
1574 for (fsi++; fsi < rp->header.maxslot; f++, fsi++)
1581 if ((rp->header.flag & BT_LEAF) && DO_INDEX(ip)) {
1586 for (n = 0; n < rp->header.nextindex; n++) {
1607 slv->offset = sp->header.stblindex + n;
1609 ((sp->header.nextindex - 1) >> L2DTSLOTSIZE) - n + 1;
1685 tpxd = &sp->header.self;
1699 pxdlock->pxd = sp->header.self;
1710 for (n = 0; n < sp->header.nextindex; n++) {
1725 sp->header.self = *pxd;
1744 oldstblindex = sp->header.stblindex;
1745 oldstblsize = (sp->header.maxslot + 31) >> L2DTSLOTSIZE;
1746 newstblindex = sp->header.maxslot;
1750 sp->header.nextindex);
1756 /* linelock header */
1771 lv->length = sp->header.maxslot + newstblsize;
1776 sp->header.maxslot = n;
1777 sp->header.stblindex = newstblindex;
1778 /* sp->header.nextindex remains the same */
1785 last = sp->header.freelist;
1790 sp->header.freelist = last;
1791 sp->header.freecnt += oldstblsize;
1799 for (fsi++; fsi < sp->header.maxslot; f++, fsi++)
1804 fsi = sp->header.freelist;
1806 sp->header.freelist = n;
1816 sp->header.freecnt += sp->header.maxslot - n;
1828 n = sp->header.maxslot >> 2;
1829 if (sp->header.freelist < n)
1934 rp->header.flag =
1935 (sp->header.flag & BT_LEAF) ? BT_LEAF : BT_INTERNAL;
1936 rp->header.self = *pxd;
1939 rp->header.next = 0;
1940 rp->header.prev = 0;
1945 /* linelock header + copied entries + new stbl (1st slot) in new page */
1953 rp->header.maxslot = n;
1957 rp->header.stblindex = DTROOTMAXSLOT;
1959 memcpy(stbl, sp->header.stbl, sp->header.nextindex);
1960 rp->header.nextindex = sp->header.nextindex;
1971 for (fsi++; fsi < rp->header.maxslot; f++, fsi++)
1976 fsi = sp->header.freelist;
1978 rp->header.freelist = n;
1980 rp->header.freelist = fsi;
1990 rp->header.freecnt = sp->header.freecnt + rp->header.maxslot - n;
1995 if ((rp->header.flag & BT_LEAF) && DO_INDEX(ip)) {
2001 for (n = 0; n < rp->header.nextindex; n++) {
2038 /* update page header of root */
2039 if (sp->header.flag & BT_LEAF) {
2040 sp->header.flag &= ~BT_LEAF;
2041 sp->header.flag |= BT_INTERNAL;
2051 stbl = sp->header.stbl;
2053 sp->header.nextindex = 1;
2064 sp->header.freelist = DTENTRYSTART + 1;
2065 sp->header.freecnt = DTROOTMAXSLOT - (DTENTRYSTART + 1);
2121 if (index == (p->header.nextindex - 1)) {
2125 if ((p->header.flag & BT_ROOT)
2126 || (p->header.next == 0))
2130 DT_GETPAGE(ip, le64_to_cpu(p->header.next),
2154 if (p->header.nextindex == 1) {
2177 /* linelock header */
2186 if (!(p->header.flag & BT_ROOT)) {
2191 lv->offset = p->header.stblindex + i;
2193 ((p->header.nextindex - 1) >> L2DTSLOTSIZE) -
2204 if (DO_INDEX(ip) && index < p->header.nextindex) {
2209 for (i = index; i < p->header.nextindex; i++) {
2281 pxdlock->pxd = fp->header.self;
2290 xlen = lengthPXD(&fp->header.self);
2320 nextindex = p->header.nextindex;
2331 if (p->header.flag & BT_ROOT) {
2357 pxdlock->pxd = p->header.self;
2366 xlen = lengthPXD(&p->header.self);
2393 /* linelock header */
2402 if (!(p->header.flag & BT_ROOT)) {
2410 lv->offset = p->header.stblindex + i;
2412 ((p->header.nextindex - 1) >> L2DTSLOTSIZE) -
2422 ((p->header.flag & BT_ROOT) || p->header.prev == 0))
2497 if (p->header.next) {
2498 nextbn = le64_to_cpu(p->header.next);
2508 if (p->header.prev) {
2509 prevbn = le64_to_cpu(p->header.prev);
2528 /* linelock header */
2535 lp->header.next = cpu_to_le64(nxaddr);
2542 /* linelock header */
2549 rp->header.prev = cpu_to_le64(nxaddr);
2564 /* linelock header */
2568 /* update the self address in the dtpage header */
2569 pxd = &p->header.self;
2576 lv->length = p->header.maxslot;
2671 if (p->header.flag & BT_ROOT) {
2674 } else if (addressPXD(&p->header.self) == lmxaddr)
2680 if (p->header.flag & BT_LEAF) {
2701 for (i = 0; i < p->header.nextindex; i++) {
2717 if (p->header.next)
2718 bn = le64_to_cpu(p->header.next);
2756 nextbn = le64_to_cpu(p->header.next);
2757 prevbn = le64_to_cpu(p->header.prev);
2776 /* linelock header */
2784 p->header.prev = cpu_to_le64(prevbn);
2805 /* linelock header */
2813 p->header.next = cpu_to_le64(nextbn);
2889 p->header.flag = DXD_INDEX | BT_ROOT | BT_LEAF;
2891 p->header.nextindex = 0;
2902 p->header.freelist = 1;
2903 p->header.freecnt = 8;
2906 p->header.idotdot = cpu_to_le32(idotdot);
2942 ASSERT(p->header.flag & BT_LEAF);
2951 for (i = 0; i < p->header.nextindex; i++) {
3086 if (p->header.flag & BT_INTERNAL) {
3194 for (i = index; i < p->header.nextindex; i++) {
3279 if (p->header.flag & BT_ROOT)
3282 bn = le64_to_cpu(p->header.next);
3361 if (p->header.flag & BT_LEAF) {
3441 if (index < p->header.nextindex)
3444 if (p->header.flag & BT_ROOT) {
3456 if (p->header.flag & BT_ROOT) {
3467 bn = le64_to_cpu(p->header.next);
3496 while (pn >= p->header.nextindex) {
3497 pn -= p->header.nextindex;
3500 bn = le64_to_cpu(p->header.next);
3540 if (index >= p->header.nextindex) {
3541 bn = le64_to_cpu(p->header.next);
3694 if (p->header.flag & BT_LEAF) {
3849 if (p->header.flag & BT_LEAF) {
3919 hsi = fsi = p->header.freelist;
3921 p->header.freelist = h->next;
3922 --p->header.freecnt;
3932 if (p->header.flag & BT_LEAF) {
3940 if (!(p->header.flag & BT_ROOT))
3941 bn = addressPXD(&p->header.self);
3967 fsi = p->header.freelist;
3969 p->header.freelist = t->next;
3970 --p->header.freecnt;
4008 if (p->header.flag & BT_LEAF)
4018 nextindex = p->header.nextindex;
4022 if ((p->header.flag & BT_LEAF) && data->leaf.ip) {
4044 ++p->header.nextindex;
4073 sstbl = (s8 *) & sp->slot[sp->header.stblindex];
4074 dstbl = (s8 *) & dp->slot[dp->header.stblindex];
4076 dsi = dp->header.freelist; /* first (whole page) free slot */
4077 sfsi = sp->header.freelist;
4092 for (di = 0; si < sp->header.nextindex; si++, di++) {
4122 if (sp->header.flag & BT_LEAF) {
4216 if (dp->header.flag & BT_LEAF)
4234 /* update source header */
4235 sp->header.freelist = sfsi;
4236 sp->header.freecnt += nd;
4238 /* update destination header */
4239 dp->header.nextindex = di;
4241 dp->header.freelist = dsi;
4242 dp->header.freecnt -= nd;
4251 * log freelist header, stbl, and each segment slot of entry
4280 if (p->header.flag & BT_LEAF)
4326 t->next = p->header.freelist;
4327 p->header.freelist = fsi;
4328 p->header.freecnt += freecnt;
4333 si = p->header.nextindex;
4337 p->header.nextindex--;
4346 * log freelist header, stbl, and each segment slot of entry
4375 ASSERT(p->header.flag & BT_INTERNAL);
4423 t->next = p->header.freelist;
4424 p->header.freelist = fsi;
4425 p->header.freecnt += freecnt;
4444 fsi = p->header.freelist;