public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: xfs@oss.sgi.com
Subject: [RFC PATCH 2/3] use xfs_reclaim_all in xfs_syncsub
Date: Tue, 24 Apr 2007 12:13:42 +0200	[thread overview]
Message-ID: <20070424101342.GC29731@lst.de> (raw)

xfs_sync_inodes currently opencodes xfs_finish_reclaim_all, except
using an m_inodes walk and checking for a NULL vnode instead of
walking m_del_inodes.  Change the code in xfs_syncsub to always
call xfs_finish_reclaim_all, and remove the code dealing with
deleted inodes without vnode from xfs_sync_inodes.


Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: linux-2.6/fs/xfs/xfs_vfsops.c
===================================================================
--- linux-2.6.orig/fs/xfs/xfs_vfsops.c	2007-04-24 10:58:55.000000000 +0200
+++ linux-2.6/fs/xfs/xfs_vfsops.c	2007-04-24 11:00:14.000000000 +0200
@@ -1018,36 +1018,15 @@ xfs_sync_inodes(
 			continue;
 		}
 
-		vp = XFS_ITOV_NULL(ip);
-
 		/*
-		 * If the vnode is gone then this is being torn down,
-		 * call reclaim if it is flushed, else let regular flush
-		 * code deal with it later in the loop.
+		 * Inodes on the delayed reclaim list are beeing dealt
+		 * with in xfs_reclaim_all.  One may have sneaked in
+		 * here after we dropped the mount ilock, but we'll leave
+		 * them to the next xfs_reclaim_all call.
 		 */
-
+		vp = XFS_ITOV_NULL(ip);
 		if (vp == NULL) {
-			/* Skip ones already in reclaim */
-			if (ip->i_flags & XFS_IRECLAIM) {
-				ip = ip->i_mnext;
-				continue;
-			}
-			if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) {
-				ip = ip->i_mnext;
-			} else if ((xfs_ipincount(ip) == 0) &&
-				    xfs_iflock_nowait(ip)) {
-				IPOINTER_INSERT(ip, mp);
-
-				xfs_finish_reclaim(ip, 1,
-						XFS_IFLUSH_DELWRI_ELSE_ASYNC);
-
-				XFS_MOUNT_ILOCK(mp);
-				mount_locked = B_TRUE;
-				IPOINTER_REMOVE(ip, mp);
-			} else {
-				xfs_iunlock(ip, XFS_ILOCK_EXCL);
-				ip = ip->i_mnext;
-			}
+			ip = ip->i_mnext;
 			continue;
 		}
 
@@ -1434,10 +1413,8 @@ xfs_syncsub(
 	xfs_log_force(mp, (xfs_lsn_t)0, log_flags);
 
 	if (flags & (SYNC_ATTR|SYNC_DELWRI)) {
-		if (flags & SYNC_BDFLUSH)
-			xfs_finish_reclaim_all(mp, 1,
-					XFS_IFLUSH_DELWRI_ELSE_ASYNC);
-		else
+		xfs_finish_reclaim_all(mp, 1, XFS_IFLUSH_DELWRI_ELSE_ASYNC);
+		if (!(flags & SYNC_BDFLUSH))
 			error = xfs_sync_inodes(mp, flags, bypassed);
 	}
 

                 reply	other threads:[~2007-04-24 10:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20070424101342.GC29731@lst.de \
    --to=hch@lst.de \
    --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