aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDave Chinner <david@fromorbit.com>2010-01-25 23:13:41 -0500
committerDave Chinner <david@fromorbit.com>2010-01-25 23:13:41 -0500
commit7d6a7bde52e449f21a0e86a7a4955b4e08a49d69 (patch)
treeb658055f660f7c825298cc2a88b3246e78fb1bce /fs
parent089716aa1480b7197bcd678b8477774c379a2768 (diff)
xfs: Use delay write promotion for dquot flushing
xfs_qm_dqflock_pushbuf_wait() does a very similar trick to item pushing used to do to flush out delayed write dquot buffers. Change it to use the new promotion method rather than an async flush. Also, xfs_qm_dqflock_pushbuf_wait() can return without the flush lock held, yet the callers make the assumption that after this call the flush lock is held. Always return with the flush lock held. Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/quota/xfs_dquot.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/fs/xfs/quota/xfs_dquot.c b/fs/xfs/quota/xfs_dquot.c
index f9baeedbfdfe..1620a56b067e 100644
--- a/fs/xfs/quota/xfs_dquot.c
+++ b/fs/xfs/quota/xfs_dquot.c
@@ -1528,21 +1528,16 @@ xfs_qm_dqflock_pushbuf_wait(
1528 */ 1528 */
1529 bp = xfs_incore(dqp->q_mount->m_ddev_targp, dqp->q_blkno, 1529 bp = xfs_incore(dqp->q_mount->m_ddev_targp, dqp->q_blkno,
1530 XFS_QI_DQCHUNKLEN(dqp->q_mount), XBF_TRYLOCK); 1530 XFS_QI_DQCHUNKLEN(dqp->q_mount), XBF_TRYLOCK);
1531 if (bp != NULL) { 1531 if (!bp)
1532 if (XFS_BUF_ISDELAYWRITE(bp)) { 1532 goto out_lock;
1533 int error; 1533
1534 1534 if (XFS_BUF_ISDELAYWRITE(bp)) {
1535 if (XFS_BUF_ISPINNED(bp)) 1535 if (XFS_BUF_ISPINNED(bp))
1536 xfs_log_force(dqp->q_mount, 0); 1536 xfs_log_force(dqp->q_mount, 0);
1537 error = xfs_bawrite(dqp->q_mount, bp); 1537 xfs_buf_delwri_promote(bp);
1538 if (error) 1538 wake_up_process(bp->b_target->bt_task);
1539 xfs_fs_cmn_err(CE_WARN, dqp->q_mount,
1540 "xfs_qm_dqflock_pushbuf_wait: "
1541 "pushbuf error %d on dqp %p, bp %p",
1542 error, dqp, bp);
1543 } else {
1544 xfs_buf_relse(bp);
1545 }
1546 } 1539 }
1540 xfs_buf_relse(bp);
1541out_lock:
1547 xfs_dqflock(dqp); 1542 xfs_dqflock(dqp);
1548} 1543}