/* Given an array of dqtrx structures, lock all the dquots associated and join them to the transaction, provided they have been modified. We know that the highest number of dquots (of one type - usr OR grp), involved in a transaction is 2 and that both usr and grp combined - 3. So, we don't attempt to make this very generic.  */
STATIC void xfs_trans_dqlockedjoin(xfs_trans_t *tp, xfs_dqtrx_t *q)
/* Given an array of dqtrx structures, lock all the dquots associated and join them to the transaction, provided they have been modified. We know that the highest number of dquots (of one type - usr OR grp), involved in a transaction is 2 and that both usr and grp combined - 3. So, we don't attempt to make this very generic.  */
STATIC void xfs_trans_dqlockedjoin(xfs_trans_t *tp, xfs_dqtrx_t *q)
{
	ASSERT(q[0].qt_dquot != NULL);
	if (q[1].qt_dquot == NULL) {
		xfs_dqlock(q[0].qt_dquot);
		xfs_trans_dqjoin(tp, q[0].qt_dquot);
	} else {
		ASSERT(XFS_QM_TRANS_MAXDQS == 2);
		xfs_dqlock2(q[0].qt_dquot, q[1].qt_dquot);
		xfs_trans_dqjoin(tp, q[0].qt_dquot);
		xfs_trans_dqjoin(tp, q[1].qt_dquot);
	}
}