xfs_ino_t		parent;		/* parent inode number */ 
xfs_ino_t		parent = 0;	/* parent inode number */ 
xfs_dir2_block_sfsize(	xfs_inode_t		*dp,		/* incore inode pointer */	xfs_dir2_block_t	*block,		/* block directory data */	xfs_dir2_sf_hdr_t	*sfhp)		/* output: header for sf form */{	xfs_dir2_dataptr_t	addr;		/* data entry address */	xfs_dir2_leaf_entry_t	*blp;		/* leaf area of the block */	xfs_dir2_block_tail_t	*btp;		/* tail area of the block */	int			count;		/* shortform entry count */	xfs_dir2_data_entry_t	*dep;		/* data entry in the block */	int			i;		/* block entry index */	int			i8count;	/* count of big-inode entries */	int			isdot;		/* entry is "." */	int			isdotdot;	/* entry is ".." */	xfs_mount_t		*mp;		/* mount structure pointer */	int			namelen;	/* total name bytes */	xfs_ino_t		parent;		/* parent inode number */	int			size=0;		/* total computed size */	mp = dp->i_mount;	count = i8count = namelen = 0;	btp = XFS_DIR2_BLOCK_TAIL_P(mp, block);	blp = XFS_DIR2_BLOCK_LEAF_P(btp);	/*	 * Iterate over the block's data entries by using the leaf pointers.	 */	for (i = 0; i < INT_GET(btp->count, ARCH_CONVERT); i++) {		if ((addr = INT_GET(blp[i].address, ARCH_CONVERT)) == XFS_DIR2_NULL_DATAPTR)			continue;		/*		 * Calculate the pointer to the entry at hand.		 */		dep = (xfs_dir2_data_entry_t *)		      ((char *)block + XFS_DIR2_DATAPTR_TO_OFF(mp, addr));		/*		 * Detect . and .., so we can special-case them.		 * . is not included in sf directories.		 * .. is included by just the parent inode number.		 */		isdot = dep->namelen == 1 && dep->name[0] == '.';		isdotdot =			dep->namelen == 2 &&			dep->name[0] == '.' && dep->name[1] == '.';#if XFS_BIG_INUMS		if (!isdot)			i8count += INT_GET(dep->inumber, ARCH_CONVERT) > XFS_DIR2_MAX_SHORT_INUM;#endif		if (!isdot && !isdotdot) {			count++;			namelen += dep->namelen;		} else if (isdotdot)			parent = INT_GET(dep->inumber, ARCH_CONVERT);		/*		 * Calculate the new size, see if we should give up yet.		 */		size = XFS_DIR2_SF_HDR_SIZE(i8count) +		/* header */		       count +					/* namelen */		       count * (uint)sizeof(xfs_dir2_sf_off_t) + /* offset */		       namelen +				/* name */		       (i8count ?				/* inumber */				(uint)sizeof(xfs_dir2_ino8_t) * count :				(uint)sizeof(xfs_dir2_ino4_t) * count);		if (size > XFS_IFORK_DSIZE(dp))			return size;		/* size value is a failure */	}	/*	 * Create the output header, if it worked.	 */	sfhp->count = count;	sfhp->i8count = i8count;	XFS_DIR2_SF_PUT_INUMBER((xfs_dir2_sf_t *)sfhp, &parent, &sfhp->parent);	return size;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/5bde1ba99c8243617277f37897189c799e398baf/xfs_dir2_sf.c/clean/fs/xfs/xfs_dir2_sf.c