Skip to contentSkip to conversation

replace xfs_iflush_all with xfs_reclaim_all

RFC PATCH New Christoph Hellwig 1 participant 1 message Apr 24, 2007 XFS filesystem

lore
Share & tools
lore
#0 lore raw

RFC PATCH 3/3 replace xfs_iflush_all with xfs_reclaim_all

xfs_iflush_all is another variant of the loop all deleted inodes without vnode and flush them scheme. Use xfs_finish_reclaim_all without the nonblock flag and with XFS_IFLUSH_ASYNC as sync_flag instead.

Btw, shouldn't xfs_quiesce_fs also pass XFS_IFLUSH_ASYNC to xfs_finish_reclaim_all?

fs/xfs/xfs_inode.c +0 -39
Index: linux-2.6/fs/xfs/xfs_inode.c
===================================================================
@@ -3518,45 +3518,6 @@ corrupt_out:
 	return XFS_ERROR(EFSCORRUPTED);
 }
 
-
-/*
- * Flush all inactive inodes in mp.
- */
-void
-xfs_iflush_all(
-	xfs_mount_t	*mp)
-{
-	xfs_inode_t	*ip;
-	bhv_vnode_t	*vp;
-
- again:
-	XFS_MOUNT_ILOCK(mp);
-	ip = mp->m_inodes;
-	if (ip == NULL)
-		goto out;
-
-	do {
-		/* Make sure we skip markers inserted by sync */
-		if (ip->i_mount == NULL) {
-			ip = ip->i_mnext;
-			continue;
-		}
-
-		vp = XFS_ITOV_NULL(ip);
-		if (!vp) {
-			XFS_MOUNT_IUNLOCK(mp);
-			xfs_finish_reclaim(ip, 0, XFS_IFLUSH_ASYNC);
-			goto again;
-		}
-
-		ASSERT(vn_count(vp) == 0);
-
-		ip = ip->i_mnext;
-	} while (ip != mp->m_inodes);
- out:
-	XFS_MOUNT_IUNLOCK(mp);
-}
-
 /*
  * xfs_iaccess: check accessibility of inode for mode.
  */
fs/xfs/xfs_inode.h +0 -1
Index: linux-2.6/fs/xfs/xfs_inode.h
===================================================================
@@ -499,7 +499,6 @@ void		xfs_ipin(xfs_inode_t *);
 void		xfs_iunpin(xfs_inode_t *);
 int		xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int);
 int		xfs_iflush(xfs_inode_t *, uint);
-void		xfs_iflush_all(struct xfs_mount *);
 int		xfs_iaccess(xfs_inode_t *, mode_t, cred_t *);
 uint		xfs_iroundup(uint);
 void		xfs_ichgtime(xfs_inode_t *, int);
fs/xfs/xfs_mount.c +1 -1
Index: linux-2.6/fs/xfs/xfs_mount.c
===================================================================
@@ -1084,7 +1084,7 @@ xfs_unmountfs(xfs_mount_t *mp, struct cr
 	int64_t		fsid;
 #endif
 
-	xfs_iflush_all(mp);
+	xfs_finish_reclaim_all(mp, 0, XFS_IFLUSH_ASYNC);
 
 	XFS_QM_DQPURGEALL(mp, XFS_QMOPT_QUOTALL | XFS_QMOPT_UMOUNTING);