public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 2/3] use xfs_reclaim_all in xfs_syncsub
@ 2007-04-24 10:13 Christoph Hellwig
  0 siblings, 0 replies; only message in thread
From: Christoph Hellwig @ 2007-04-24 10:13 UTC (permalink / raw)
  To: xfs

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);
 	}
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-04-24 10:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-24 10:13 [RFC PATCH 2/3] use xfs_reclaim_all in xfs_syncsub Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox