summaryrefslogtreecommitdiff
path: root/fs/jfs/jfs_dtree.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jfs/jfs_dtree.c')
-rw-r--r--fs/jfs/jfs_dtree.c199
1 files changed, 0 insertions, 199 deletions
diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
index 8676aee3ae4..73b5fc7eda8 100644
--- a/fs/jfs/jfs_dtree.c
+++ b/fs/jfs/jfs_dtree.c
@@ -4554,202 +4554,3 @@ int dtModify(tid_t tid, struct inode *ip,
return 0;
}
-
-#ifdef _JFS_DEBUG_DTREE
-/*
- * dtDisplayTree()
- *
- * function: traverse forward
- */
-int dtDisplayTree(struct inode *ip)
-{
- int rc;
- struct metapage *mp;
- dtpage_t *p;
- s64 bn, pbn;
- int index, lastindex, v, h;
- pxd_t *xd;
- struct btstack btstack;
- struct btframe *btsp;
- struct btframe *parent;
- u8 *stbl;
- int psize = 256;
-
- printk("display B+-tree.\n");
-
- /* clear stack */
- btsp = btstack.stack;
-
- /*
- * start with root
- *
- * root resides in the inode
- */
- bn = 0;
- v = h = 0;
-
- /*
- * first access of each page:
- */
- newPage:
- DT_GETPAGE(ip, bn, mp, psize, p, rc);
- if (rc)
- return rc;
-
- /* process entries forward from first index */
- index = 0;
- lastindex = p->header.nextindex - 1;
-
- if (p->header.flag & BT_INTERNAL) {
- /*
- * first access of each internal page
- */
- printf("internal page ");
- dtDisplayPage(ip, bn, p);
-
- goto getChild;
- } else { /* (p->header.flag & BT_LEAF) */
-
- /*
- * first access of each leaf page
- */
- printf("leaf page ");
- dtDisplayPage(ip, bn, p);
-
- /*
- * process leaf page entries
- *
- for ( ; index <= lastindex; index++)
- {
- }
- */
-
- /* unpin the leaf page */
- DT_PUTPAGE(mp);
- }
-
- /*
- * go back up to the parent page
- */
- getParent:
- /* pop/restore parent entry for the current child page */
- if ((parent = (btsp == btstack.stack ? NULL : --btsp)) == NULL)
- /* current page must have been root */
- return;
-
- /*
- * parent page scan completed
- */
- if ((index = parent->index) == (lastindex = parent->lastindex)) {
- /* go back up to the parent page */
- goto getParent;
- }
-
- /*
- * parent page has entries remaining
- */
- /* get back the parent page */
- bn = parent->bn;
- /* v = parent->level; */
- DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
- if (rc)
- return rc;
-
- /* get next parent entry */
- index++;
-
- /*
- * internal page: go down to child page of current entry
- */
- getChild:
- /* push/save current parent entry for the child page */
- btsp->bn = pbn = bn;
- btsp->index = index;
- btsp->lastindex = lastindex;
- /* btsp->level = v; */
- /* btsp->node = h; */
- ++btsp;
-
- /* get current entry for the child page */
- stbl = DT_GETSTBL(p);
- xd = (pxd_t *) & p->slot[stbl[index]];
-
- /*
- * first access of each internal entry:
- */
-
- /* get child page */
- bn = addressPXD(xd);
- psize = lengthPXD(xd) << ip->i_ipmnt->i_l2bsize;
-
- printk("traverse down 0x%Lx[%d]->0x%Lx\n", pbn, index, bn);
- v++;
- h = index;
-
- /* release parent page */
- DT_PUTPAGE(mp);
-
- /* process the child page */
- goto newPage;
-}
-
-
-/*
- * dtDisplayPage()
- *
- * function: display page
- */
-int dtDisplayPage(struct inode *ip, s64 bn, dtpage_t * p)
-{
- int rc;
- struct metapage *mp;
- struct ldtentry *lh;
- struct idtentry *ih;
- pxd_t *xd;
- int i, j;
- u8 *stbl;
- wchar_t name[JFS_NAME_MAX + 1];
- struct component_name key = { 0, name };
- int freepage = 0;
-
- if (p == NULL) {
- freepage = 1;
- DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
- if (rc)
- return rc;
- }
-
- /* display page control */
- printk("bn:0x%Lx flag:0x%08x nextindex:%d\n",
- bn, p->header.flag, p->header.nextindex);
-
- /* display entries */
- stbl = DT_GETSTBL(p);
- for (i = 0, j = 1; i < p->header.nextindex; i++, j++) {
- dtGetKey(p, i, &key, JFS_SBI(ip->i_sb)->mntflag);
- key.name[key.namlen] = '\0';
- if (p->header.flag & BT_LEAF) {
- lh = (struct ldtentry *) & p->slot[stbl[i]];
- printf("\t[%d] %s:%d", i, key.name,
- le32_to_cpu(lh->inumber));
- } else {
- ih = (struct idtentry *) & p->slot[stbl[i]];
- xd = (pxd_t *) ih;
- bn = addressPXD(xd);
- printf("\t[%d] %s:0x%Lx", i, key.name, bn);
- }
-
- if (j == 4) {
- printf("\n");
- j = 0;
- }
- }
-
- printf("\n");
-
- if (freepage)
- DT_PUTPAGE(mp);
-
- return 0;
-}
-#endif /* _JFS_DEBUG_DTREE */