/* Gets called when unmounting a filesystem or when all quotas get turned off. This purges the quota inodes, destroys locks and frees itself.  */
void xfs_qm_destroy_quotainfo(xfs_mount_t *mp)
/* Gets called when unmounting a filesystem or when all quotas get turned off. This purges the quota inodes, destroys locks and frees itself.  */
void xfs_qm_destroy_quotainfo(xfs_mount_t *mp)
{
	xfs_quotainfo_t *qi;
	qi = mp->m_quotainfo;
	ASSERT(qi != NULL);
	ASSERT(xfs_Gqm != NULL);
	xfs_qm_rele_quotafs_ref(mp);
	xfs_qm_list_destroy(&qi->qi_dqlist);
	if (qi->qi_uquotaip) {
		IRELE(qi->qi_uquotaip);
		qi->qi_uquotaip = NULL;
	}
	if (qi->qi_gquotaip) {
		IRELE(qi->qi_gquotaip);
		qi->qi_gquotaip = NULL;
	}
	mutex_destroy(&qi->qi_quotaofflock);
	kmem_free(qi);
	mp->m_quotainfo = NULL;
}