/* Return 1 if directory contains only "." and "..".  */
int xfs_dir_isempty(xfs_inode_t *dp)
/* Return 1 if directory contains only "." and "..".  */
int xfs_dir_isempty(xfs_inode_t *dp)
{
	xfs_dir2_sf_t	*sfp;
	ASSERT((dp->i_d.di_mode & S_IFMT) == S_IFDIR);
	if (dp->i_d.di_size == 0)
		return 1;
	if (dp->i_d.di_size > XFS_IFORK_DSIZE(dp))
		return 0;
	sfp = (xfs_dir2_sf_t *)dp->i_df.if_u1.if_data;
	return !sfp->hdr.count;
}