xfs: untangle SYNC_WAIT and SYNC_TRYLOCK meanings for xfs_qm_dqflush
authorChristoph Hellwig <hch@infradead.org>
Tue, 6 Dec 2011 21:58:10 +0000 (21:58 +0000)
committerBen Myers <bpm@sgi.com>
Mon, 12 Dec 2011 22:31:01 +0000 (16:31 -0600)
Only skip pinned dquots if SYNC_TRYLOCK is specified, and adjust the callers
to keep the behaviour unchanged.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
fs/xfs/xfs_dquot.c
fs/xfs/xfs_dquot_item.c
fs/xfs/xfs_qm.c

index 25d7280e9f6bb9de30822fed909cda099d7fbee1..9aef727a48b258df553df9d6454aa5f82d0a6ced 100644 (file)
@@ -1169,7 +1169,7 @@ xfs_qm_dqflush(
         * If not dirty, or it's pinned and we are not supposed to block, nada.
         */
        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);
                return 0;
        }
index 79da711e5dd22a078549ebca6af309faaab4e18f..3956e1bb7c0770f62b39ffe1afc391ab3ebdb8b6 100644 (file)
@@ -133,7 +133,7 @@ xfs_qm_dquot_logitem_push(
         * lock without sleeping, then there must not have been
         * anyone in the process of flushing the dquot.
         */
-       error = xfs_qm_dqflush(dqp, 0);
+       error = xfs_qm_dqflush(dqp, SYNC_TRYLOCK);
        if (error)
                xfs_warn(dqp->q_mount, "%s: push error %d on dqp %p",
                        __func__, error, dqp);
index 0bbb1a41998bc95563813ef8a584e104aad5c462..93cafacbed3c2d7800f42be52fe74a5baa071ed5 100644 (file)
@@ -1661,7 +1661,7 @@ xfs_qm_quotacheck(
         * successfully.
         */
        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
@@ -1874,7 +1874,7 @@ again:
                         * We flush it delayed write, so don't bother
                         * releasing the freelist lock.
                         */
-                       error = xfs_qm_dqflush(dqp, 0);
+                       error = xfs_qm_dqflush(dqp, SYNC_TRYLOCK);
                        if (error) {
                                xfs_warn(mp, "%s: dquot %p flush failed",
                                        __func__, dqp);
This page took 0.073133 seconds and 5 git commands to generate.