diff options
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_buf.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_buf.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index 44e20e578ba0..b306265caa33 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c | |||
@@ -1778,6 +1778,35 @@ xfs_buf_delwri_dequeue( | |||
1778 | trace_xfs_buf_delwri_dequeue(bp, _RET_IP_); | 1778 | trace_xfs_buf_delwri_dequeue(bp, _RET_IP_); |
1779 | } | 1779 | } |
1780 | 1780 | ||
1781 | /* | ||
1782 | * If a delwri buffer needs to be pushed before it has aged out, then promote | ||
1783 | * it to the head of the delwri queue so that it will be flushed on the next | ||
1784 | * xfsbufd run. We do this by resetting the queuetime of the buffer to be older | ||
1785 | * than the age currently needed to flush the buffer. Hence the next time the | ||
1786 | * xfsbufd sees it is guaranteed to be considered old enough to flush. | ||
1787 | */ | ||
1788 | void | ||
1789 | xfs_buf_delwri_promote( | ||
1790 | struct xfs_buf *bp) | ||
1791 | { | ||
1792 | struct xfs_buftarg *btp = bp->b_target; | ||
1793 | long age = xfs_buf_age_centisecs * msecs_to_jiffies(10) + 1; | ||
1794 | |||
1795 | ASSERT(bp->b_flags & XBF_DELWRI); | ||
1796 | ASSERT(bp->b_flags & _XBF_DELWRI_Q); | ||
1797 | |||
1798 | /* | ||
1799 | * Check the buffer age before locking the delayed write queue as we | ||
1800 | * don't need to promote buffers that are already past the flush age. | ||
1801 | */ | ||
1802 | if (bp->b_queuetime < jiffies - age) | ||
1803 | return; | ||
1804 | bp->b_queuetime = jiffies - age; | ||
1805 | spin_lock(&btp->bt_delwrite_lock); | ||
1806 | list_move(&bp->b_list, &btp->bt_delwrite_queue); | ||
1807 | spin_unlock(&btp->bt_delwrite_lock); | ||
1808 | } | ||
1809 | |||
1781 | STATIC void | 1810 | STATIC void |
1782 | xfs_buf_runall_queues( | 1811 | xfs_buf_runall_queues( |
1783 | struct workqueue_struct *queue) | 1812 | struct workqueue_struct *queue) |