Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 48008296 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs

* 'for-linus' of git://oss.sgi.com/xfs/xfs:
  xfs: revert to using a kthread for AIL pushing
  xfs: force the log if we encounter pinned buffers in .iop_pushbuf
  xfs: do not update xa_last_pushed_lsn for locked items
parents 95bc156c 0030807c
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -629,7 +629,7 @@ xfs_buf_item_push(
 * the xfsbufd to get this buffer written. We have to unlock the buffer
 * the xfsbufd to get this buffer written. We have to unlock the buffer
 * to allow the xfsbufd to write it, too.
 * to allow the xfsbufd to write it, too.
 */
 */
STATIC void
STATIC bool
xfs_buf_item_pushbuf(
xfs_buf_item_pushbuf(
	struct xfs_log_item	*lip)
	struct xfs_log_item	*lip)
{
{
@@ -643,6 +643,7 @@ xfs_buf_item_pushbuf(


	xfs_buf_delwri_promote(bp);
	xfs_buf_delwri_promote(bp);
	xfs_buf_relse(bp);
	xfs_buf_relse(bp);
	return true;
}
}


STATIC void
STATIC void
+7 −3
Original line number Original line Diff line number Diff line
@@ -183,13 +183,14 @@ xfs_qm_dqunpin_wait(
 * search the buffer cache can be a time consuming thing, and AIL lock is a
 * search the buffer cache can be a time consuming thing, and AIL lock is a
 * spinlock.
 * spinlock.
 */
 */
STATIC void
STATIC bool
xfs_qm_dquot_logitem_pushbuf(
xfs_qm_dquot_logitem_pushbuf(
	struct xfs_log_item	*lip)
	struct xfs_log_item	*lip)
{
{
	struct xfs_dq_logitem	*qlip = DQUOT_ITEM(lip);
	struct xfs_dq_logitem	*qlip = DQUOT_ITEM(lip);
	struct xfs_dquot	*dqp = qlip->qli_dquot;
	struct xfs_dquot	*dqp = qlip->qli_dquot;
	struct xfs_buf		*bp;
	struct xfs_buf		*bp;
	bool			ret = true;


	ASSERT(XFS_DQ_IS_LOCKED(dqp));
	ASSERT(XFS_DQ_IS_LOCKED(dqp));


@@ -201,17 +202,20 @@ xfs_qm_dquot_logitem_pushbuf(
	if (completion_done(&dqp->q_flush) ||
	if (completion_done(&dqp->q_flush) ||
	    !(lip->li_flags & XFS_LI_IN_AIL)) {
	    !(lip->li_flags & XFS_LI_IN_AIL)) {
		xfs_dqunlock(dqp);
		xfs_dqunlock(dqp);
		return;
		return true;
	}
	}


	bp = xfs_incore(dqp->q_mount->m_ddev_targp, qlip->qli_format.qlf_blkno,
	bp = xfs_incore(dqp->q_mount->m_ddev_targp, qlip->qli_format.qlf_blkno,
			dqp->q_mount->m_quotainfo->qi_dqchunklen, XBF_TRYLOCK);
			dqp->q_mount->m_quotainfo->qi_dqchunklen, XBF_TRYLOCK);
	xfs_dqunlock(dqp);
	xfs_dqunlock(dqp);
	if (!bp)
	if (!bp)
		return;
		return true;
	if (XFS_BUF_ISDELAYWRITE(bp))
	if (XFS_BUF_ISDELAYWRITE(bp))
		xfs_buf_delwri_promote(bp);
		xfs_buf_delwri_promote(bp);
	if (xfs_buf_ispinned(bp))
		ret = false;
	xfs_buf_relse(bp);
	xfs_buf_relse(bp);
	return ret;
}
}


/*
/*
+7 −3
Original line number Original line Diff line number Diff line
@@ -708,13 +708,14 @@ xfs_inode_item_committed(
 * marked delayed write. If that's the case, we'll promote it and that will
 * marked delayed write. If that's the case, we'll promote it and that will
 * allow the caller to write the buffer by triggering the xfsbufd to run.
 * allow the caller to write the buffer by triggering the xfsbufd to run.
 */
 */
STATIC void
STATIC bool
xfs_inode_item_pushbuf(
xfs_inode_item_pushbuf(
	struct xfs_log_item	*lip)
	struct xfs_log_item	*lip)
{
{
	struct xfs_inode_log_item *iip = INODE_ITEM(lip);
	struct xfs_inode_log_item *iip = INODE_ITEM(lip);
	struct xfs_inode	*ip = iip->ili_inode;
	struct xfs_inode	*ip = iip->ili_inode;
	struct xfs_buf		*bp;
	struct xfs_buf		*bp;
	bool			ret = true;


	ASSERT(xfs_isilocked(ip, XFS_ILOCK_SHARED));
	ASSERT(xfs_isilocked(ip, XFS_ILOCK_SHARED));


@@ -725,7 +726,7 @@ xfs_inode_item_pushbuf(
	if (completion_done(&ip->i_flush) ||
	if (completion_done(&ip->i_flush) ||
	    !(lip->li_flags & XFS_LI_IN_AIL)) {
	    !(lip->li_flags & XFS_LI_IN_AIL)) {
		xfs_iunlock(ip, XFS_ILOCK_SHARED);
		xfs_iunlock(ip, XFS_ILOCK_SHARED);
		return;
		return true;
	}
	}


	bp = xfs_incore(ip->i_mount->m_ddev_targp, iip->ili_format.ilf_blkno,
	bp = xfs_incore(ip->i_mount->m_ddev_targp, iip->ili_format.ilf_blkno,
@@ -733,10 +734,13 @@ xfs_inode_item_pushbuf(


	xfs_iunlock(ip, XFS_ILOCK_SHARED);
	xfs_iunlock(ip, XFS_ILOCK_SHARED);
	if (!bp)
	if (!bp)
		return;
		return true;
	if (XFS_BUF_ISDELAYWRITE(bp))
	if (XFS_BUF_ISDELAYWRITE(bp))
		xfs_buf_delwri_promote(bp);
		xfs_buf_delwri_promote(bp);
	if (xfs_buf_ispinned(bp))
		ret = false;
	xfs_buf_relse(bp);
	xfs_buf_relse(bp);
	return ret;
}
}


/*
/*
+2 −0
Original line number Original line Diff line number Diff line
@@ -68,6 +68,8 @@
#include <linux/ctype.h>
#include <linux/ctype.h>
#include <linux/writeback.h>
#include <linux/writeback.h>
#include <linux/capability.h>
#include <linux/capability.h>
#include <linux/kthread.h>
#include <linux/freezer.h>
#include <linux/list_sort.h>
#include <linux/list_sort.h>


#include <asm/page.h>
#include <asm/page.h>
+1 −12
Original line number Original line Diff line number Diff line
@@ -1652,24 +1652,13 @@ xfs_init_workqueues(void)
	 */
	 */
	xfs_syncd_wq = alloc_workqueue("xfssyncd", WQ_CPU_INTENSIVE, 8);
	xfs_syncd_wq = alloc_workqueue("xfssyncd", WQ_CPU_INTENSIVE, 8);
	if (!xfs_syncd_wq)
	if (!xfs_syncd_wq)
		goto out;

	xfs_ail_wq = alloc_workqueue("xfsail", WQ_CPU_INTENSIVE, 8);
	if (!xfs_ail_wq)
		goto out_destroy_syncd;

	return 0;

out_destroy_syncd:
	destroy_workqueue(xfs_syncd_wq);
out:
		return -ENOMEM;
		return -ENOMEM;
	return 0;
}
}


STATIC void
STATIC void
xfs_destroy_workqueues(void)
xfs_destroy_workqueues(void)
{
{
	destroy_workqueue(xfs_ail_wq);
	destroy_workqueue(xfs_syncd_wq);
	destroy_workqueue(xfs_syncd_wq);
}
}


Loading