public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: xfs@oss.sgi.com
Subject: [PATCH 05/10] XFS: xfssyncd: don't call xfs_sync
Date: Sat, 13 Sep 2008 23:57:05 +1000	[thread overview]
Message-ID: <1221314230-28618-6-git-send-email-david@fromorbit.com> (raw)
In-Reply-To: <1221314230-28618-1-git-send-email-david@fromorbit.com>

Start de-multiplexing xfs_sync() by making xfs_sync_worker()
call the specific sync functions it needs. This is only a small,
unique subset of the entire xfs_sync() code so is easier to
follow.

Signed-off-by: Dave Chinner <david@fromorbit.com>
---
 fs/xfs/linux-2.6/xfs_sync.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c
index d4b7b21..3c31137 100644
--- a/fs/xfs/linux-2.6/xfs_sync.c
+++ b/fs/xfs/linux-2.6/xfs_sync.c
@@ -526,6 +526,11 @@ xfs_flush_device(
 	xfs_log_force(ip->i_mount, (xfs_lsn_t)0, XFS_LOG_FORCE|XFS_LOG_SYNC);
 }
 
+/*
+ * Every sync period we need to unpin all items, reclaim inodes, sync
+ * quota and write out the superblock. We might need to cover the log
+ * to indicate it is idle.
+ */
 STATIC void
 xfs_sync_worker(
 	struct xfs_mount *mp,
@@ -533,8 +538,15 @@ xfs_sync_worker(
 {
 	int		error;
 
-	if (!(mp->m_flags & XFS_MOUNT_RDONLY))
-		error = xfs_sync(mp, SYNC_FSDATA | SYNC_BDFLUSH | SYNC_ATTR);
+	if (!(mp->m_flags & XFS_MOUNT_RDONLY)) {
+		xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE);
+		xfs_finish_reclaim_all(mp, 1, XFS_IFLUSH_DELWRI_ELSE_ASYNC);
+		/* dgc: errors ignored here */
+		error = XFS_QM_DQSYNC(mp, SYNC_BDFLUSH);
+		error = xfs_sync_fsdata(mp, SYNC_BDFLUSH);
+		if (xfs_log_need_covered(mp))
+			error = xfs_commit_dummy_trans(mp, XFS_LOG_FORCE);
+	}
 	mp->m_sync_seq++;
 	wake_up(&mp->m_wait_single_sync_task);
 }
-- 
1.5.6

  parent reply	other threads:[~2008-09-13 13:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-13 13:57 [PATCH 0/10] XFS: clean up sync code Dave Chinner
2008-09-13 13:57 ` [PATCH 01/10] XFS: split out two helpers from xfs_syncsub Dave Chinner
2008-09-13 16:53   ` Josef 'Jeff' Sipek
2008-09-13 20:34     ` Dave Chinner
2008-09-13 13:57 ` [PATCH 02/10] XFS: Use struct inodes instead of vnodes to kill vn_grab Dave Chinner
2008-09-13 13:57 ` [PATCH 03/10] XFS: use xfs_sync_inodes rather than xfs_syncsub Dave Chinner
2008-09-13 13:57 ` [PATCH 04/10] XFS: kill xfs_syncsub Dave Chinner
2008-09-13 13:57 ` Dave Chinner [this message]
2008-09-13 16:58   ` [PATCH 05/10] XFS: xfssyncd: don't call xfs_sync Josef 'Jeff' Sipek
2008-09-13 20:35     ` Dave Chinner
2008-09-14 13:23       ` Christoph Hellwig
2008-09-13 13:57 ` [PATCH 06/10] XFS: make SYNC_ATTR no longer use xfs_sync Dave Chinner
2008-09-13 13:57 ` [PATCH 07/10] XFS: make SYNC_DELWRI no longer use xfs_sync V2 Dave Chinner
2008-09-13 13:57 ` [PATCH 08/10] XFS: Kill SYNC_CLOSE Dave Chinner
2008-09-13 13:57 ` [PATCH 09/10] XFS: Kill xfs_sync() Dave Chinner
2008-09-13 13:57 ` [PATCH 10/10] XFS: Move remaining quiesce code Dave Chinner
2008-09-14 13:24 ` [PATCH 0/10] XFS: clean up sync code Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2008-10-07 21:43 Dave Chinner
2008-10-07 21:43 ` [PATCH 05/10] XFS: xfssyncd: don't call xfs_sync Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1221314230-28618-6-git-send-email-david@fromorbit.com \
    --to=david@fromorbit.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox