Commit fdedf28b authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Ben Myers

xfs: untangle SYNC_WAIT and SYNC_TRYLOCK meanings for xfs_qm_dqflush

Only skip pinned dquots if SYNC_TRYLOCK is specified, and adjust the callers
to keep the behaviour unchanged.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Signed-off-by: default avatarBen Myers <bpm@sgi.com>
parent b3934213
...@@ -1169,7 +1169,7 @@ xfs_qm_dqflush( ...@@ -1169,7 +1169,7 @@ xfs_qm_dqflush(
* If not dirty, or it's pinned and we are not supposed to block, nada. * If not dirty, or it's pinned and we are not supposed to block, nada.
*/ */
if (!XFS_DQ_IS_DIRTY(dqp) || if (!XFS_DQ_IS_DIRTY(dqp) ||
(!(flags & SYNC_WAIT) && atomic_read(&dqp->q_pincount) > 0)) { ((flags & SYNC_TRYLOCK) && atomic_read(&dqp->q_pincount) > 0)) {
xfs_dqfunlock(dqp); xfs_dqfunlock(dqp);
return 0; return 0;
} }
......
...@@ -133,7 +133,7 @@ xfs_qm_dquot_logitem_push( ...@@ -133,7 +133,7 @@ xfs_qm_dquot_logitem_push(
* lock without sleeping, then there must not have been * lock without sleeping, then there must not have been
* anyone in the process of flushing the dquot. * anyone in the process of flushing the dquot.
*/ */
error = xfs_qm_dqflush(dqp, 0); error = xfs_qm_dqflush(dqp, SYNC_TRYLOCK);
if (error) if (error)
xfs_warn(dqp->q_mount, "%s: push error %d on dqp %p", xfs_warn(dqp->q_mount, "%s: push error %d on dqp %p",
__func__, error, dqp); __func__, error, dqp);
......
...@@ -1661,7 +1661,7 @@ xfs_qm_quotacheck( ...@@ -1661,7 +1661,7 @@ xfs_qm_quotacheck(
* successfully. * successfully.
*/ */
if (!error) if (!error)
error = xfs_qm_dqflush_all(mp, 0); error = xfs_qm_dqflush_all(mp, SYNC_TRYLOCK);
/* /*
* We can get this error if we couldn't do a dquot allocation inside * We can get this error if we couldn't do a dquot allocation inside
...@@ -1874,7 +1874,7 @@ xfs_qm_dqreclaim_one(void) ...@@ -1874,7 +1874,7 @@ xfs_qm_dqreclaim_one(void)
* We flush it delayed write, so don't bother * We flush it delayed write, so don't bother
* releasing the freelist lock. * releasing the freelist lock.
*/ */
error = xfs_qm_dqflush(dqp, 0); error = xfs_qm_dqflush(dqp, SYNC_TRYLOCK);
if (error) { if (error) {
xfs_warn(mp, "%s: dquot %p flush failed", xfs_warn(mp, "%s: dquot %p flush failed",
__func__, dqp); __func__, dqp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment