/* After the last attribute is removed revert to original inode format, making all literal area available to the data fork once more.  */
STATIC void xfs_attr_fork_reset(struct xfs_inode *ip, struct xfs_trans *tp)
/* After the last attribute is removed revert to original inode format, making all literal area available to the data fork once more.  */
STATIC void xfs_attr_fork_reset(struct xfs_inode *ip, struct xfs_trans *tp)
{
	xfs_idestroy_fork(ip, XFS_ATTR_FORK);
	ip->i_d.di_forkoff = 0;
	ip->i_d.di_aformat = XFS_DINODE_FMT_EXTENTS;
	ASSERT(ip->i_d.di_anextents == 0);
	ASSERT(ip->i_afp == NULL);
	ip->i_df.if_ext_max = XFS_IFORK_DSIZE(ip) / sizeof(xfs_bmbt_rec_t);
	xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
}