aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_super.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2009-06-08 09:35:48 -0400
committerChristoph Hellwig <hch@brick.lst.de>2009-06-08 09:35:48 -0400
commit075fe1028699f6a280545dfc2cfc5ac82d555c8c (patch)
treeaf17172ddc4d97d73b6a9a39f6dcf0ca2659fcdc /fs/xfs/linux-2.6/xfs_super.c
parentfe588ed32867b42e0d906db558ca92fd9f8b128e (diff)
xfs: split xfs_sync_inodes
xfs_sync_inodes is used to write back either file data or inode metadata. In general we always do these separately, except for one fishy case in xfs_fs_put_super that does both. So separate xfs_sync_inodes into separate xfs_sync_data and xfs_sync_attr functions. In xfs_fs_put_super we first call the data sync and then the attr sync as that was the previous order. The moved log force in that path doesn't make a difference because we will force the log again as part of the real unmount process. The filesystem readonly checks are not performed by the new function but instead moved into the callers, given that most callers alredy have it further up in the stack. Also add debug checks that we do not pass in incorrect flags in the new xfs_sync_data and xfs_sync_attr function and fix the one place that did pass in a wrong flag. Also remove a comment mentioning xfs_sync_inodes that has been incorrect for a while because we always take either the iolock or ilock in the sync path these days. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_super.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 0d9b64b219e0..d4e7ef8f8df9 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -1071,7 +1071,18 @@ xfs_fs_put_super(
1071 int unmount_event_flags = 0; 1071 int unmount_event_flags = 0;
1072 1072
1073 xfs_syncd_stop(mp); 1073 xfs_syncd_stop(mp);
1074 xfs_sync_inodes(mp, SYNC_ATTR|SYNC_DELWRI); 1074
1075 if (!(sb->s_flags & MS_RDONLY)) {
1076 /*
1077 * XXX(hch): this should be SYNC_WAIT.
1078 *
1079 * Or more likely not needed at all because the VFS is already
1080 * calling ->sync_fs after shutting down all filestem
1081 * operations and just before calling ->put_super.
1082 */
1083 xfs_sync_data(mp, 0);
1084 xfs_sync_attr(mp, 0);
1085 }
1075 1086
1076#ifdef HAVE_DMAPI 1087#ifdef HAVE_DMAPI
1077 if (mp->m_flags & XFS_MOUNT_DMAPI) { 1088 if (mp->m_flags & XFS_MOUNT_DMAPI) {