if ((rc = xtSearch(ip, xoff - 1, &cmp, &btstack, XT_INSERT))) 
if ((rc = xtSearch(ip, xoff - 1, NULL, &cmp, &btstack, XT_INSERT))) 
int xtExtend(tid_t tid,		/* transaction id */	     struct inode *ip, s64 xoff,	/* delta extent offset */	     s32 xlen,		/* delta extent length */	     int flag){	int rc = 0;	int cmp;	struct metapage *mp;	/* meta-page buffer */	xtpage_t *p;		/* base B+-tree index page */	s64 bn;	int index, nextindex, len;	struct btstack btstack;	/* traverse stack */	struct xtsplit split;	/* split information */	xad_t *xad;	s64 xaddr;	struct tlock *tlck;	struct xtlock *xtlck = NULL;	jfs_info("xtExtend: nxoff:0x%lx nxlen:0x%x", (ulong) xoff, xlen);	/* there must exist extent to be extended */	if ((rc = xtSearch(ip, xoff - 1, &cmp, &btstack, XT_INSERT)))		return rc;	/* retrieve search result */	XT_GETSEARCH(ip, btstack.top, bn, mp, p, index);	if (cmp != 0) {		XT_PUTPAGE(mp);		jfs_error(ip->i_sb, "xtExtend: xtSearch did not find extent");		return -EIO;	}	/* extension must be contiguous */	xad = &p->xad[index];	if ((offsetXAD(xad) + lengthXAD(xad)) != xoff) {		XT_PUTPAGE(mp);		jfs_error(ip->i_sb, "xtExtend: extension is not contiguous");		return -EIO;	}	/*	 * acquire a transaction lock on the leaf page;	 *	 * action: xad insertion/extension;	 */	BT_MARK_DIRTY(mp, ip);	if (!test_cflag(COMMIT_Nolink, ip)) {		tlck = txLock(tid, ip, mp, tlckXTREE | tlckGROW);		xtlck = (struct xtlock *) & tlck->lock;	}	/* extend will overflow extent ? */	xlen = lengthXAD(xad) + xlen;	if ((len = xlen - MAXXLEN) <= 0)		goto extendOld;	/*	 *      extent overflow: insert entry for new extent	 *///insertNew:	xoff = offsetXAD(xad) + MAXXLEN;	xaddr = addressXAD(xad) + MAXXLEN;	nextindex = le16_to_cpu(p->header.nextindex);	/*	 *      if the leaf page is full, insert the new entry and	 *      propagate up the router entry for the new page from split	 *	 * The xtSplitUp() will insert the entry and unpin the leaf page.	 */	if (nextindex == le16_to_cpu(p->header.maxentry)) {		/* xtSpliUp() unpins leaf pages */		split.mp = mp;		split.index = index + 1;		split.flag = XAD_NEW;		split.off = xoff;	/* split offset */		split.len = len;		split.addr = xaddr;		split.pxdlist = NULL;		if ((rc = xtSplitUp(tid, ip, &split, &btstack)))			return rc;		/* get back old page */		XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);		if (rc)			return rc;		/*		 * if leaf root has been split, original root has been		 * copied to new child page, i.e., original entry now		 * resides on the new child page;		 */		if (p->header.flag & BT_INTERNAL) {			ASSERT(p->header.nextindex ==			       cpu_to_le16(XTENTRYSTART + 1));			xad = &p->xad[XTENTRYSTART];			bn = addressXAD(xad);			XT_PUTPAGE(mp);			/* get new child page */			XT_GETPAGE(ip, bn, mp, PSIZE, p, rc);			if (rc)				return rc;			BT_MARK_DIRTY(mp, ip);			if (!test_cflag(COMMIT_Nolink, ip)) {				tlck = txLock(tid, ip, mp, tlckXTREE|tlckGROW);				xtlck = (struct xtlock *) & tlck->lock;			}		}	}	/*	 *      insert the new entry into the leaf page	 */	else {		/* insert the new entry: mark the entry NEW */		xad = &p->xad[index + 1];		XT_PUTENTRY(xad, XAD_NEW, xoff, len, xaddr);		/* advance next available entry index */		p->header.nextindex =		    cpu_to_le16(le16_to_cpu(p->header.nextindex) + 1);	}	/* get back old entry */	xad = &p->xad[index];	xlen = MAXXLEN;	/*	 * extend old extent	 */      extendOld:	XADlength(xad, xlen);	if (!(xad->flag & XAD_NEW))		xad->flag |= XAD_EXTENDED;	if (!test_cflag(COMMIT_Nolink, ip)) {		xtlck->lwm.offset =		    (xtlck->lwm.offset) ? min(index,					      (int)xtlck->lwm.offset) : index;		xtlck->lwm.length =		    le16_to_cpu(p->header.nextindex) - xtlck->lwm.offset;	}	/* unpin the leaf page */	XT_PUTPAGE(mp);	return rc;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/6628465e33ca694bd8fd5c3cf4eb7ff9177bc694/jfs_xtree.c/clean/fs/jfs/jfs_xtree.c