mirror of https://github.com/torvalds/linux.git
xfs: push q_qlock acquisition from xchk_dquot_iter to the callers.
There is no good reason to take q_qlock in xchk_dquot_iter, which just provides a reference to the dquot. 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
e85e74e4c9
commit
a536bf9bec
|
|
@ -205,7 +205,6 @@ xchk_dquot_iter(
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
mutex_lock(&dq->q_qlock);
|
|
||||||
cursor->id = dq->q_id + 1;
|
cursor->id = dq->q_id + 1;
|
||||||
*dqpp = dq;
|
*dqpp = dq;
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
||||||
|
|
@ -329,6 +329,7 @@ xchk_quota(
|
||||||
/* Now look for things that the quota verifiers won't complain about. */
|
/* Now look for things that the quota verifiers won't complain about. */
|
||||||
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 = xchk_quota_item(&sqi, dq);
|
error = xchk_quota_item(&sqi, dq);
|
||||||
mutex_unlock(&dq->q_qlock);
|
mutex_unlock(&dq->q_qlock);
|
||||||
xfs_qm_dqrele(dq);
|
xfs_qm_dqrele(dq);
|
||||||
|
|
|
||||||
|
|
@ -512,6 +512,7 @@ xrep_quota_problems(
|
||||||
|
|
||||||
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 = xrep_quota_item(&rqi, dq);
|
error = xrep_quota_item(&rqi, dq);
|
||||||
mutex_unlock(&dq->q_qlock);
|
mutex_unlock(&dq->q_qlock);
|
||||||
xfs_qm_dqrele(dq);
|
xfs_qm_dqrele(dq);
|
||||||
|
|
|
||||||
|
|
@ -675,6 +675,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);
|
mutex_unlock(&dq->q_qlock);
|
||||||
xfs_qm_dqrele(dq);
|
xfs_qm_dqrele(dq);
|
||||||
|
|
|
||||||
|
|
@ -155,6 +155,7 @@ xqcheck_commit_dqtype(
|
||||||
*/
|
*/
|
||||||
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_commit_dquot(xqc, dqtype, dq);
|
error = xqcheck_commit_dquot(xqc, dqtype, dq);
|
||||||
mutex_unlock(&dq->q_qlock);
|
mutex_unlock(&dq->q_qlock);
|
||||||
xfs_qm_dqrele(dq);
|
xfs_qm_dqrele(dq);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue