diff options
author | David Chinner <david@fromorbit.com> | 2008-10-30 02:06:28 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@sgi.com> | 2008-10-30 02:06:28 -0400 |
commit | 75c68f411b1242c8fdaf731078fdd4e77b14981d (patch) | |
tree | 776eab26d76e14dc0478015d1f352c5d2bea9daa /fs/xfs/xfs_vnodeops.c | |
parent | a167b17e899a930758506bbc18748078d6fd8c89 (diff) |
[XFS] Remove xfs_iflush_all and clean up xfs_finish_reclaim_all()
xfs_iflush_all() walks the m_inodes list to find inodes that need
reclaiming. We already have such a list - the m_del_inodes list. Replace
xfs_iflush_all() with a call to xfs_finish_reclaim_all() and clean up
xfs_finish_reclaim_all() to handle the different flush modes now needed.
Originally based on a patch from Christoph Hellwig.
Version 3 o rediff against new linux-2.6/xfs_sync.c code
Version 2 o revert xfs_syncsub() inode reclaim behaviour back to original
code o xfs_quiesce_fs() should use XFS_IFLUSH_DELWRI_ELSE_ASYNC, not
XFS_IFLUSH_ASYNC, to prevent change of behaviour.
SGI-PV: 988139
SGI-Modid: xfs-linux-melb:xfs-kern:32284a
Signed-off-by: David Chinner <david@fromorbit.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r-- | fs/xfs/xfs_vnodeops.c | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 8b6812f66a15..a6714579a414 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -2918,36 +2918,30 @@ xfs_finish_reclaim( | |||
2918 | } | 2918 | } |
2919 | 2919 | ||
2920 | int | 2920 | int |
2921 | xfs_finish_reclaim_all(xfs_mount_t *mp, int noblock) | 2921 | xfs_finish_reclaim_all( |
2922 | xfs_mount_t *mp, | ||
2923 | int noblock, | ||
2924 | int mode) | ||
2922 | { | 2925 | { |
2923 | int purged; | ||
2924 | xfs_inode_t *ip, *n; | 2926 | xfs_inode_t *ip, *n; |
2925 | int done = 0; | ||
2926 | 2927 | ||
2927 | while (!done) { | 2928 | restart: |
2928 | purged = 0; | 2929 | XFS_MOUNT_ILOCK(mp); |
2929 | XFS_MOUNT_ILOCK(mp); | 2930 | list_for_each_entry_safe(ip, n, &mp->m_del_inodes, i_reclaim) { |
2930 | list_for_each_entry_safe(ip, n, &mp->m_del_inodes, i_reclaim) { | 2931 | if (noblock) { |
2931 | if (noblock) { | 2932 | if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) |
2932 | if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) | 2933 | continue; |
2933 | continue; | 2934 | if (xfs_ipincount(ip) || |
2934 | if (xfs_ipincount(ip) || | 2935 | !xfs_iflock_nowait(ip)) { |
2935 | !xfs_iflock_nowait(ip)) { | 2936 | xfs_iunlock(ip, XFS_ILOCK_EXCL); |
2936 | xfs_iunlock(ip, XFS_ILOCK_EXCL); | 2937 | continue; |
2937 | continue; | ||
2938 | } | ||
2939 | } | 2938 | } |
2940 | XFS_MOUNT_IUNLOCK(mp); | ||
2941 | if (xfs_finish_reclaim(ip, noblock, | ||
2942 | XFS_IFLUSH_DELWRI_ELSE_ASYNC)) | ||
2943 | delay(1); | ||
2944 | purged = 1; | ||
2945 | break; | ||
2946 | } | 2939 | } |
2947 | 2940 | XFS_MOUNT_IUNLOCK(mp); | |
2948 | done = !purged; | 2941 | if (xfs_finish_reclaim(ip, noblock, mode)) |
2942 | delay(1); | ||
2943 | goto restart; | ||
2949 | } | 2944 | } |
2950 | |||
2951 | XFS_MOUNT_IUNLOCK(mp); | 2945 | XFS_MOUNT_IUNLOCK(mp); |
2952 | return 0; | 2946 | return 0; |
2953 | } | 2947 | } |