aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_sync.c
diff options
context:
space:
mode:
authorDavid Chinner <david@fromorbit.com>2008-10-30 02:16:00 -0400
committerLachlan McIlroy <lachlan@sgi.com>2008-10-30 02:16:00 -0400
commitcb56a4b995d44b7990ca3acd18db571eedd0649f (patch)
tree85fad110902a8929593fb5820c61fae7d56ac8a1 /fs/xfs/linux-2.6/xfs_sync.c
parente9f1c6ee12955fd8657f6f0f9a3d09112b1f1fdd (diff)
[XFS] Kill SYNC_CLOSE
SYNC_CLOSE is only ever used and checked in conjunction with SYNC_WAIT, and this only done in one spot. The only thing this does is make XFS_bflush() calls to the data buftargs. This will happen very shortly afterwards the xfs_sync() call anyway in the unmount path via the xfs_close_devices(), so this code is redundant and can be removed. That only user of SYNC_CLOSE is now gone, so kill the flag completely. SGI-PV: 988140 SGI-Modid: xfs-linux-melb:xfs-kern:32310a 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/linux-2.6/xfs_sync.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_sync.c31
1 files changed, 2 insertions, 29 deletions
diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c
index 838070ce7249..91a54a79a09b 100644
--- a/fs/xfs/linux-2.6/xfs_sync.c
+++ b/fs/xfs/linux-2.6/xfs_sync.c
@@ -70,7 +70,7 @@ xfs_sync_inodes_ag(
70 if (flags & SYNC_WAIT) 70 if (flags & SYNC_WAIT)
71 fflag = 0; /* synchronous overrides all */ 71 fflag = 0; /* synchronous overrides all */
72 72
73 if (flags & (SYNC_DELWRI | SYNC_CLOSE)) { 73 if (flags & SYNC_DELWRI) {
74 /* 74 /*
75 * We need the I/O lock if we're going to call any of 75 * We need the I/O lock if we're going to call any of
76 * the flush/inval routines. 76 * the flush/inval routines.
@@ -117,7 +117,7 @@ xfs_sync_inodes_ag(
117 } 117 }
118 118
119 /* nothing to sync during shutdown */ 119 /* nothing to sync during shutdown */
120 if (XFS_FORCED_SHUTDOWN(mp) && !(flags & SYNC_CLOSE)) { 120 if (XFS_FORCED_SHUTDOWN(mp)) {
121 read_unlock(&pag->pag_ici_lock); 121 read_unlock(&pag->pag_ici_lock);
122 return 0; 122 return 0;
123 } 123 }
@@ -152,20 +152,6 @@ xfs_sync_inodes_ag(
152 * If we need to drop the lock, insert a marker if we 152 * If we need to drop the lock, insert a marker if we
153 * have not already done so. 153 * have not already done so.
154 */ 154 */
155 if (flags & SYNC_CLOSE) {
156 xfs_iunlock(ip, XFS_ILOCK_SHARED);
157 if (XFS_FORCED_SHUTDOWN(mp))
158 xfs_tosspages(ip, 0, -1, FI_REMAPF);
159 else
160 error = xfs_flushinval_pages(ip, 0, -1,
161 FI_REMAPF);
162 /* wait for I/O on freeze */
163 if (flags & SYNC_IOWAIT)
164 vn_iowait(ip);
165
166 xfs_ilock(ip, XFS_ILOCK_SHARED);
167 }
168
169 if ((flags & SYNC_DELWRI) && VN_DIRTY(inode)) { 155 if ((flags & SYNC_DELWRI) && VN_DIRTY(inode)) {
170 xfs_iunlock(ip, XFS_ILOCK_SHARED); 156 xfs_iunlock(ip, XFS_ILOCK_SHARED);
171 error = xfs_flush_pages(ip, 0, -1, fflag, FI_NONE); 157 error = xfs_flush_pages(ip, 0, -1, fflag, FI_NONE);
@@ -390,8 +376,6 @@ xfs_quiesce_data(
390 * inodes. SYNC_WAIT and SYNC_BDFLUSH are used to 376 * inodes. SYNC_WAIT and SYNC_BDFLUSH are used to
391 * determine if they should be flushed sync, async, or 377 * determine if they should be flushed sync, async, or
392 * delwri. 378 * delwri.
393 * SYNC_CLOSE - This flag is passed when the system is being
394 * unmounted. We should sync and invalidate everything.
395 * SYNC_FSDATA - This indicates that the caller would like to make 379 * SYNC_FSDATA - This indicates that the caller would like to make
396 * sure the superblock is safe on disk. We can ensure 380 * sure the superblock is safe on disk. We can ensure
397 * this by simply making sure the log gets flushed 381 * this by simply making sure the log gets flushed
@@ -472,17 +456,6 @@ xfs_sync(
472 return error; 456 return error;
473 } 457 }
474 458
475 /*
476 * When shutting down, we need to insure that the AIL is pushed
477 * to disk or the filesystem can appear corrupt from the PROM.
478 */
479 if ((flags & (SYNC_CLOSE|SYNC_WAIT)) == (SYNC_CLOSE|SYNC_WAIT)) {
480 XFS_bflush(mp->m_ddev_targp);
481 if (mp->m_rtdev_targp) {
482 XFS_bflush(mp->m_rtdev_targp);
483 }
484 }
485
486 return XFS_ERROR(last_error); 459 return XFS_ERROR(last_error);
487} 460}
488 461