rc = xtSearch(ip, xoff, &cmp, &btstack, 0); 
rc = xtSearch(ip, xoff, NULL, &cmp, &btstack, 0); 
s64 xtTruncate_pmap(tid_t tid, struct inode *ip, s64 committed_size){	s64 bn;	struct btstack btstack;	int cmp;	int index;	int locked_leaves = 0;	struct metapage *mp;	xtpage_t *p;	struct btframe *parent;	int rc;	struct tblock *tblk;	struct tlock *tlck = NULL;	xad_t *xad;	int xlen;	s64 xoff;	struct xtlock *xtlck = NULL;	/* save object truncation type */	tblk = tid_to_tblock(tid);	tblk->xflag |= COMMIT_PMAP;	/* clear stack */	BT_CLR(&btstack);	if (committed_size) {		xoff = (committed_size >> JFS_SBI(ip->i_sb)->l2bsize) - 1;		rc = xtSearch(ip, xoff, &cmp, &btstack, 0);		if (rc)			return rc;		XT_GETSEARCH(ip, btstack.top, bn, mp, p, index);		if (cmp != 0) {			XT_PUTPAGE(mp);			jfs_error(ip->i_sb,				  "xtTruncate_pmap: did not find extent");			return -EIO;		}	} else {		/*		 * start with root		 *		 * root resides in the inode		 */		bn = 0;		/*		 * first access of each page:		 */      getPage:		XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);		if (rc)			return rc;		/* process entries backward from last index */		index = le16_to_cpu(p->header.nextindex) - 1;		if (p->header.flag & BT_INTERNAL)			goto getChild;	}	/*	 *      leaf page	 */	if (++locked_leaves > MAX_TRUNCATE_LEAVES) {		/*		 * We need to limit the size of the transaction		 * to avoid exhausting pagecache & tlocks		 */		xad = &p->xad[index];		xoff = offsetXAD(xad);		xlen = lengthXAD(xad);		XT_PUTPAGE(mp);		return  (xoff + xlen) << JFS_SBI(ip->i_sb)->l2bsize;	}	tlck = txLock(tid, ip, mp, tlckXTREE);	tlck->type = tlckXTREE | tlckFREE;	xtlck = (struct xtlock *) & tlck->lock;	xtlck->hwm.offset = index;	XT_PUTPAGE(mp);	/*	 * go back up to the parent page	 */      getParent:	/* pop/restore parent entry for the current child page */	if ((parent = BT_POP(&btstack)) == NULL)		/* current page must have been root */		goto out;	/* get back the parent page */	bn = parent->bn;	XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);	if (rc)		return rc;	index = parent->index;	/*	 * parent page become empty: free the page	 */	if (index == XTENTRYSTART) {		/* txCommit() with tlckFREE:		 * free child extents covered by parent;		 * invalidate parent if COMMIT_PWMAP;		 */		tlck = txLock(tid, ip, mp, tlckXTREE);		xtlck = (struct xtlock *) & tlck->lock;		xtlck->hwm.offset =		    le16_to_cpu(p->header.nextindex) - 1;		tlck->type = tlckXTREE | tlckFREE;		XT_PUTPAGE(mp);		if (p->header.flag & BT_ROOT) {			goto out;		} else {			goto getParent;		}	}	/*	 * parent page still has entries for front region;	 */	else		index--;	/*	 *      internal page: go down to child page of current entry	 */      getChild:	/* save current parent entry for the child page */	BT_PUSH(&btstack, bn, index);	/* get child page */	xad = &p->xad[index];	bn = addressXAD(xad);	/*	 * first access of each internal entry:	 */	/* release parent page */	XT_PUTPAGE(mp);	/* process the child page */	goto getPage;      out:	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/6628465e33ca694bd8fd5c3cf4eb7ff9177bc694/jfs_xtree.c/clean/fs/jfs/jfs_xtree.c