useextra = state->extravalid && XFS_DIR_IS_V1(state->mp); 
useextra = state->extravalid && (XFS_DIR_IS_V1(state->mp) || state->args->whichfork == XFS_ATTR_FORK); 
xfs_da_node_split(xfs_da_state_t *state, xfs_da_state_blk_t *oldblk,				 xfs_da_state_blk_t *newblk,				 xfs_da_state_blk_t *addblk,				 int treelevel, int *result){	xfs_da_intnode_t *node;	xfs_dablk_t blkno;	int newcount, error;	int useextra;	node = oldblk->bp->data;	ASSERT(INT_GET(node->hdr.info.magic, ARCH_CONVERT) == XFS_DA_NODE_MAGIC);	/*	 * With V2 the extra block is data or freespace.	 */	useextra = state->extravalid && XFS_DIR_IS_V1(state->mp);	newcount = 1 + useextra;	/*	 * Do we have to split the node?	 */	if ((INT_GET(node->hdr.count, ARCH_CONVERT) + newcount) > state->node_ents) {		/*		 * Allocate a new node, add to the doubly linked chain of		 * nodes, then move some of our excess entries into it.		 */		error = xfs_da_grow_inode(state->args, &blkno);		if (error)			return(error);	/* GROT: dir is inconsistent */		error = xfs_da_node_create(state->args, blkno, treelevel,					   &newblk->bp, state->args->whichfork);		if (error)			return(error);	/* GROT: dir is inconsistent */		newblk->blkno = blkno;		newblk->magic = XFS_DA_NODE_MAGIC;		xfs_da_node_rebalance(state, oldblk, newblk);		error = xfs_da_blk_link(state, oldblk, newblk);		if (error)			return(error);		*result = 1;	} else {		*result = 0;	}	/*	 * Insert the new entry(s) into the correct block	 * (updating last hashval in the process).	 *	 * xfs_da_node_add() inserts BEFORE the given index,	 * and as a result of using node_lookup_int() we always	 * point to a valid entry (not after one), but a split	 * operation always results in a new block whose hashvals	 * FOLLOW the current block.	 *	 * If we had double-split op below us, then add the extra block too.	 */	node = oldblk->bp->data;	if (oldblk->index <= INT_GET(node->hdr.count, ARCH_CONVERT)) {		oldblk->index++;		xfs_da_node_add(state, oldblk, addblk);		if (useextra) {			if (state->extraafter)				oldblk->index++;			xfs_da_node_add(state, oldblk, &state->extrablk);			state->extravalid = 0;		}	} else {		newblk->index++;		xfs_da_node_add(state, newblk, addblk);		if (useextra) {			if (state->extraafter)				newblk->index++;			xfs_da_node_add(state, newblk, &state->extrablk);			state->extravalid = 0;		}	}	return(0);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/bf6f05aa0bb6f1fe9a9ce35287678c3916bddfef/xfs_da_btree.c/buggy/fs/xfs/xfs_da_btree.c