mirror of https://github.com/torvalds/linux.git
xfs: move q_qlock locking into xqcheck_compare_dquot
Instead of having both callers do it. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
parent
bfca8760f4
commit
7dd30acb4b
|
|
@ -563,6 +563,7 @@ xqcheck_compare_dquot(
|
||||||
return -ECANCELED;
|
return -ECANCELED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mutex_lock(&dq->q_qlock);
|
||||||
mutex_lock(&xqc->lock);
|
mutex_lock(&xqc->lock);
|
||||||
error = xfarray_load_sparse(counts, dq->q_id, &xcdq);
|
error = xfarray_load_sparse(counts, dq->q_id, &xcdq);
|
||||||
if (error)
|
if (error)
|
||||||
|
|
@ -589,7 +590,9 @@ xqcheck_compare_dquot(
|
||||||
xchk_set_incomplete(xqc->sc);
|
xchk_set_incomplete(xqc->sc);
|
||||||
error = -ECANCELED;
|
error = -ECANCELED;
|
||||||
}
|
}
|
||||||
|
out_unlock:
|
||||||
mutex_unlock(&xqc->lock);
|
mutex_unlock(&xqc->lock);
|
||||||
|
mutex_unlock(&dq->q_qlock);
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
|
|
@ -597,10 +600,6 @@ xqcheck_compare_dquot(
|
||||||
return -ECANCELED;
|
return -ECANCELED;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
out_unlock:
|
|
||||||
mutex_unlock(&xqc->lock);
|
|
||||||
return error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -635,9 +634,7 @@ xqcheck_walk_observations(
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
mutex_lock(&dq->q_qlock);
|
|
||||||
error = xqcheck_compare_dquot(xqc, dqtype, dq);
|
error = xqcheck_compare_dquot(xqc, dqtype, dq);
|
||||||
mutex_unlock(&dq->q_qlock);
|
|
||||||
xfs_qm_dqrele(dq);
|
xfs_qm_dqrele(dq);
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
|
|
@ -675,9 +672,7 @@ xqcheck_compare_dqtype(
|
||||||
/* Compare what we observed against the actual dquots. */
|
/* Compare what we observed against the actual dquots. */
|
||||||
xchk_dqiter_init(&cursor, sc, dqtype);
|
xchk_dqiter_init(&cursor, sc, dqtype);
|
||||||
while ((error = xchk_dquot_iter(&cursor, &dq)) == 1) {
|
while ((error = xchk_dquot_iter(&cursor, &dq)) == 1) {
|
||||||
mutex_lock(&dq->q_qlock);
|
|
||||||
error = xqcheck_compare_dquot(xqc, dqtype, dq);
|
error = xqcheck_compare_dquot(xqc, dqtype, dq);
|
||||||
mutex_unlock(&dq->q_qlock);
|
|
||||||
xfs_qm_dqrele(dq);
|
xfs_qm_dqrele(dq);
|
||||||
if (error)
|
if (error)
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue