/* Release dquots (and their references) if any. The inode should be locked EXCL except when this's called by xfs_ireclaim.  */
void xfs_qm_dqdetach(xfs_inode_t *ip)
/* Release dquots (and their references) if any. The inode should be locked EXCL except when this's called by xfs_ireclaim.  */
void xfs_qm_dqdetach(xfs_inode_t *ip)
{
	if (!(ip->i_udquot || ip->i_gdquot))
		return;
	trace_xfs_dquot_dqdetach(ip);
	ASSERT(ip->i_ino != ip->i_mount->m_sb.sb_uquotino);
	ASSERT(ip->i_ino != ip->i_mount->m_sb.sb_gquotino);
	if (ip->i_udquot) {
		xfs_qm_dqrele(ip->i_udquot);
		ip->i_udquot = NULL;
	}
	if (ip->i_gdquot) {
		xfs_qm_dqrele(ip->i_gdquot);
		ip->i_gdquot = NULL;
	}
}