/* This is the dquot flushing I/O completion routine. It is called from interrupt level when the buffer containing the dquot is flushed to disk. It is responsible for removing the dquot logitem from the AIL if it has not been re-logged, and unlocking the dquot's flush lock. This behavior is very similar to that of inodes..  */
STATIC void xfs_qm_dqflush_done(xfs_buf_t *, xfs_dq_logitem_t *)
/* This is the dquot flushing I/O completion routine. It is called from interrupt level when the buffer containing the dquot is flushed to disk. It is responsible for removing the dquot logitem from the AIL if it has not been re-logged, and unlocking the dquot's flush lock. This behavior is very similar to that of inodes..  */
STATIC void xfs_qm_dqflush_done(xfs_buf_t *, xfs_dq_logitem_t *)
{
	xfs_dquot_t		*dqp;
	struct xfs_ail		*ailp;
	dqp = qip->qli_dquot;
	ailp = qip->qli_item.li_ailp;
	if ((qip->qli_item.li_flags & XFS_LI_IN_AIL) &&
	    qip->qli_item.li_lsn == qip->qli_flush_lsn) {
		spin_lock(&ailp->xa_lock);
		if (qip->qli_item.li_lsn == qip->qli_flush_lsn)
			xfs_trans_ail_delete(ailp, (xfs_log_item_t*)qip);
		else
			spin_unlock(&ailp->xa_lock);
	}
	xfs_dqfunlock(dqp);
}