Lines Matching refs:sp
188 static void dtMoveEntry(dtpage_t * sp, int si, dtpage_t * dp,
936 dtpage_t *sp; /* split page */ in dtSplitUp() local
958 sp = DT_PAGE(ip, smp); in dtSplitUp()
976 if (sp->header.flag & BT_ROOT) { in dtSplitUp()
983 n -= DTROOTMAXSLOT - sp->header.freecnt; /* header + entries */ in dtSplitUp()
1018 pxd = &sp->header.self; in dtSplitUp()
1025 if ((n + sp->header.freecnt) <= split->nslot) in dtSplitUp()
1132 lp = sp; in dtSplitUp()
1138 DT_GETPAGE(ip, parent->bn, smp, PSIZE, sp, rc); in dtSplitUp()
1183 if ((sp->header.flag & BT_ROOT && skip > 1) || in dtSplitUp()
1184 sp->header.prev != 0 || skip > 1) { in dtSplitUp()
1232 if (n > sp->header.freecnt) { in dtSplitUp()
1247 rc = (sp->header.flag & BT_ROOT) ? in dtSplitUp()
1276 if (!(sp->header.flag & BT_ROOT)) { in dtSplitUp()
1279 lv->offset = sp->header.stblindex + n; in dtSplitUp()
1281 ((sp->header.nextindex - in dtSplitUp()
1286 dtInsertEntry(sp, skip, &key, data, &dtlck); in dtSplitUp()
1335 dtpage_t *sp; in dtSplitPage() local
1358 sp = DT_PAGE(ip, smp); in dtSplitPage()
1410 nextbn = le64_to_cpu(sp->header.next); in dtSplitPage()
1412 rp->header.prev = cpu_to_le64(addressPXD(&sp->header.self)); in dtSplitPage()
1413 sp->header.next = cpu_to_le64(rbn); in dtSplitPage()
1418 rp->header.flag = sp->header.flag; in dtSplitPage()
1446 if (nextbn == 0 && split->index == sp->header.nextindex) { in dtSplitPage()
1514 stbl = (u8 *) & sp->slot[sp->header.stblindex]; in dtSplitPage()
1515 nextindex = sp->header.nextindex; in dtSplitPage()
1522 switch (sp->header.flag & BT_TYPE) { in dtSplitPage()
1524 ldtentry = (struct ldtentry *) & sp->slot[si]; in dtSplitPage()
1533 idtentry = (struct idtentry *) & sp->slot[si]; in dtSplitPage()
1565 dtMoveEntry(sp, nxt, rp, &sdtlck, &rdtlck, DO_INDEX(ip)); in dtSplitPage()
1567 sp->header.nextindex = nxt; in dtSplitPage()
1600 dtInsertEntry(sp, skip, split->key, split->data, &sdtlck); in dtSplitPage()
1607 slv->offset = sp->header.stblindex + n; in dtSplitPage()
1609 ((sp->header.nextindex - 1) >> L2DTSLOTSIZE) - n + 1; in dtSplitPage()
1648 dtpage_t *sp, *pp; in dtExtendPage() local
1669 sp = DT_PAGE(ip, smp); in dtExtendPage()
1685 tpxd = &sp->header.self; in dtExtendPage()
1699 pxdlock->pxd = sp->header.self; in dtExtendPage()
1709 stbl = DT_GETSTBL(sp); in dtExtendPage()
1710 for (n = 0; n < sp->header.nextindex; n++) { in dtExtendPage()
1712 (struct ldtentry *) & sp->slot[stbl[n]]; in dtExtendPage()
1725 sp->header.self = *pxd; in dtExtendPage()
1727 jfs_info("dtExtendPage: ip:0x%p smp:0x%p sp:0x%p", ip, smp, sp); in dtExtendPage()
1744 oldstblindex = sp->header.stblindex; in dtExtendPage()
1745 oldstblsize = (sp->header.maxslot + 31) >> L2DTSLOTSIZE; in dtExtendPage()
1746 newstblindex = sp->header.maxslot; in dtExtendPage()
1749 memcpy(&sp->slot[newstblindex], &sp->slot[oldstblindex], in dtExtendPage()
1750 sp->header.nextindex); in dtExtendPage()
1771 lv->length = sp->header.maxslot + newstblsize; in dtExtendPage()
1776 sp->header.maxslot = n; in dtExtendPage()
1777 sp->header.stblindex = newstblindex; in dtExtendPage()
1784 f = &sp->slot[fsi]; in dtExtendPage()
1785 last = sp->header.freelist; in dtExtendPage()
1790 sp->header.freelist = last; in dtExtendPage()
1791 sp->header.freecnt += oldstblsize; in dtExtendPage()
1798 f = &sp->slot[fsi]; in dtExtendPage()
1799 for (fsi++; fsi < sp->header.maxslot; f++, fsi++) in dtExtendPage()
1804 fsi = sp->header.freelist; in dtExtendPage()
1806 sp->header.freelist = n; in dtExtendPage()
1809 f = &sp->slot[fsi]; in dtExtendPage()
1816 sp->header.freecnt += sp->header.maxslot - n; in dtExtendPage()
1821 dtInsertEntry(sp, split->index, split->key, split->data, &dtlck); in dtExtendPage()
1828 n = sp->header.maxslot >> 2; in dtExtendPage()
1829 if (sp->header.freelist < n) in dtExtendPage()
1830 dtLinelockFreelist(sp, n, &dtlck); in dtExtendPage()
1880 dtroot_t *sp; in dtSplitRoot() local
1900 sp = &JFS_IP(ip)->i_dtroot; in dtSplitRoot()
1935 (sp->header.flag & BT_LEAF) ? BT_LEAF : BT_INTERNAL; in dtSplitRoot()
1959 memcpy(stbl, sp->header.stbl, sp->header.nextindex); in dtSplitRoot()
1960 rp->header.nextindex = sp->header.nextindex; in dtSplitRoot()
1963 memcpy(&rp->slot[1], &sp->slot[1], IDATASIZE); in dtSplitRoot()
1976 fsi = sp->header.freelist; in dtSplitRoot()
1990 rp->header.freecnt = sp->header.freecnt + rp->header.maxslot - n; in dtSplitRoot()
2039 if (sp->header.flag & BT_LEAF) { in dtSplitRoot()
2040 sp->header.flag &= ~BT_LEAF; in dtSplitRoot()
2041 sp->header.flag |= BT_INTERNAL; in dtSplitRoot()
2045 s = (struct idtentry *) & sp->slot[DTENTRYSTART]; in dtSplitRoot()
2051 stbl = sp->header.stbl; in dtSplitRoot()
2053 sp->header.nextindex = 1; in dtSplitRoot()
2057 f = &sp->slot[fsi]; in dtSplitRoot()
2064 sp->header.freelist = DTENTRYSTART + 1; in dtSplitRoot()
2065 sp->header.freecnt = DTROOTMAXSLOT - (DTENTRYSTART + 1); in dtSplitRoot()
4056 static void dtMoveEntry(dtpage_t * sp, int si, dtpage_t * dp, in dtMoveEntry() argument
4073 sstbl = (s8 *) & sp->slot[sp->header.stblindex]; in dtMoveEntry()
4077 sfsi = sp->header.freelist; in dtMoveEntry()
4092 for (di = 0; si < sp->header.nextindex; si++, di++) { in dtMoveEntry()
4121 s = &sp->slot[ssi]; in dtMoveEntry()
4122 if (sp->header.flag & BT_LEAF) { in dtMoveEntry()
4189 s = &sp->slot[ssi]; in dtMoveEntry()
4235 sp->header.freelist = sfsi; in dtMoveEntry()
4236 sp->header.freecnt += nd; in dtMoveEntry()