diff options
author | Dave Chinner <david@fromorbit.com> | 2010-01-26 15:13:41 +1100 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2010-01-26 15:13:41 +1100 |
commit | 7d6a7bde52e449f21a0e86a7a4955b4e08a49d69 (patch) | |
tree | b658055f660f7c825298cc2a88b3246e78fb1bce /fs | |
parent | 089716aa1480b7197bcd678b8477774c379a2768 (diff) | |
download | linux-7d6a7bde52e449f21a0e86a7a4955b4e08a49d69.tar.gz linux-7d6a7bde52e449f21a0e86a7a4955b4e08a49d69.tar.bz2 linux-7d6a7bde52e449f21a0e86a7a4955b4e08a49d69.zip |
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.c | 25 |
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( */ bp = xfs_incore(dqp->q_mount->m_ddev_targp, dqp->q_blkno, XFS_QI_DQCHUNKLEN(dqp->q_mount), XBF_TRYLOCK); - if (bp != NULL) { - if (XFS_BUF_ISDELAYWRITE(bp)) { - int error; - - if (XFS_BUF_ISPINNED(bp)) - xfs_log_force(dqp->q_mount, 0); - error = xfs_bawrite(dqp->q_mount, bp); - if (error) - xfs_fs_cmn_err(CE_WARN, dqp->q_mount, - "xfs_qm_dqflock_pushbuf_wait: " - "pushbuf error %d on dqp %p, bp %p", - error, dqp, bp); - } else { - xfs_buf_relse(bp); - } + if (!bp) + goto out_lock; + + if (XFS_BUF_ISDELAYWRITE(bp)) { + if (XFS_BUF_ISPINNED(bp)) + xfs_log_force(dqp->q_mount, 0); + xfs_buf_delwri_promote(bp); + wake_up_process(bp->b_target->bt_task); } + xfs_buf_relse(bp); +out_lock: xfs_dqflock(dqp); } |