xfs_ino_t parent; 
xfs_ino_t parent = 0; 
xfs_dir_leaf_to_shortform(xfs_da_args_t *iargs){	xfs_dir_leafblock_t *leaf;	xfs_dir_leaf_hdr_t *hdr;	xfs_dir_leaf_entry_t *entry;	xfs_dir_leaf_name_t *namest;	xfs_da_args_t args;	xfs_inode_t *dp;	xfs_ino_t parent;	char *tmpbuffer;	int retval, i;	xfs_dabuf_t *bp;	dp = iargs->dp;	tmpbuffer = kmem_alloc(XFS_LBSIZE(dp->i_mount), KM_SLEEP);	ASSERT(tmpbuffer != NULL);	retval = xfs_da_read_buf(iargs->trans, iargs->dp, 0, -1, &bp,					       XFS_DATA_FORK);	if (retval)		goto out;	ASSERT(bp != NULL);	memcpy(tmpbuffer, bp->data, XFS_LBSIZE(dp->i_mount));	leaf = (xfs_dir_leafblock_t *)tmpbuffer;	ASSERT(INT_GET(leaf->hdr.info.magic, ARCH_CONVERT) == XFS_DIR_LEAF_MAGIC);	memset(bp->data, 0, XFS_LBSIZE(dp->i_mount));	/*	 * Find and special case the parent inode number	 */	hdr = &leaf->hdr;	entry = &leaf->entries[0];	for (i = INT_GET(hdr->count, ARCH_CONVERT)-1; i >= 0; entry++, i--) {		namest = XFS_DIR_LEAF_NAMESTRUCT(leaf, INT_GET(entry->nameidx, ARCH_CONVERT));		if ((entry->namelen == 2) &&		    (namest->name[0] == '.') &&		    (namest->name[1] == '.')) {			XFS_DIR_SF_GET_DIRINO(&namest->inumber, &parent);			entry->nameidx = 0;		} else if ((entry->namelen == 1) && (namest->name[0] == '.')) {			entry->nameidx = 0;		}	}	retval = xfs_da_shrink_inode(iargs, 0, bp);	if (retval)		goto out;	retval = xfs_dir_shortform_create(iargs, parent);	if (retval)		goto out;	/*	 * Copy the rest of the filenames	 */	entry = &leaf->entries[0];	args.dp = dp;	args.firstblock = iargs->firstblock;	args.flist = iargs->flist;	args.total = iargs->total;	args.whichfork = XFS_DATA_FORK;	args.trans = iargs->trans;	args.justcheck = 0;	args.addname = args.oknoent = 1;	for (i = 0; i < INT_GET(hdr->count, ARCH_CONVERT); entry++, i++) {		if (!entry->nameidx)			continue;		namest = XFS_DIR_LEAF_NAMESTRUCT(leaf, INT_GET(entry->nameidx, ARCH_CONVERT));		args.name = (char *)(namest->name);		args.namelen = entry->namelen;		args.hashval = INT_GET(entry->hashval, ARCH_CONVERT);		XFS_DIR_SF_GET_DIRINO(&namest->inumber, &args.inumber);		xfs_dir_shortform_addname(&args);	}out:	kmem_free(tmpbuffer, XFS_LBSIZE(dp->i_mount));	return(retval);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/5bde1ba99c8243617277f37897189c799e398baf/xfs_dir_leaf.c/clean/fs/xfs/xfs_dir_leaf.c