xfs
[Top] [All Lists]

[PATCH 16/45] xfs: untange SYNC_WAIT and SYNC_TRYLOCK meanings for xfs_q

To: xfs@xxxxxxxxxxx
Subject: [PATCH 16/45] xfs: untange SYNC_WAIT and SYNC_TRYLOCK meanings for xfs_qm_dqflush
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Fri, 28 Oct 2011 05:54:39 -0400
References: <20111028095423.796574703@xxxxxxxxxxxxxxxxxxxxxx>
User-agent: quilt/0.48-1
Only skip pinned dquots if SYNC_TRYLOCK is specified, and adjust the callers
to keep the behaviour unchanged.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>

---
 fs/xfs/xfs_dquot.c      |    2 +-
 fs/xfs/xfs_dquot_item.c |    2 +-
 fs/xfs/xfs_qm.c         |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

Index: xfs/fs/xfs/xfs_dquot.c
===================================================================
--- xfs.orig/fs/xfs/xfs_dquot.c 2011-10-27 22:39:34.952673735 +0200
+++ xfs/fs/xfs/xfs_dquot.c      2011-10-27 22:40:00.076675206 +0200
@@ -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: xfs/fs/xfs/xfs_dquot_item.c
===================================================================
--- xfs.orig/fs/xfs/xfs_dquot_item.c    2011-10-27 22:39:42.528674212 +0200
+++ xfs/fs/xfs/xfs_dquot_item.c 2011-10-27 22:40:00.080676002 +0200
@@ -134,7 +134,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: xfs/fs/xfs/xfs_qm.c
===================================================================
--- xfs.orig/fs/xfs/xfs_qm.c    2011-10-27 22:39:34.980673855 +0200
+++ xfs/fs/xfs/xfs_qm.c 2011-10-27 22:40:00.080676002 +0200
@@ -1660,7 +1660,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

<Prev in Thread] Current Thread [Next in Thread>