aboutsummaryrefslogtreecommitdiffstats
path: root/fs
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
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')
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c10
-rw-r--r--fs/xfs/linux-2.6/xfs_sync.c31
-rw-r--r--fs/xfs/linux-2.6/xfs_sync.h1
3 files changed, 2 insertions, 40 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 376f32d92475..60ecf47b9f05 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -1026,16 +1026,6 @@ xfs_fs_put_super(
1026 error = xfs_unmount_flush(mp, 0); 1026 error = xfs_unmount_flush(mp, 0);
1027 WARN_ON(error); 1027 WARN_ON(error);
1028 1028
1029 /*
1030 * If we're forcing a shutdown, typically because of a media error,
1031 * we want to make sure we invalidate dirty pages that belong to
1032 * referenced vnodes as well.
1033 */
1034 if (XFS_FORCED_SHUTDOWN(mp)) {
1035 error = xfs_sync(mp, SYNC_WAIT | SYNC_CLOSE);
1036 ASSERT(error != EFSCORRUPTED);
1037 }
1038
1039 if (mp->m_flags & XFS_MOUNT_DMAPI) { 1029 if (mp->m_flags & XFS_MOUNT_DMAPI) {
1040 XFS_SEND_UNMOUNT(mp, rip, DM_RIGHT_NULL, 0, 0, 1030 XFS_SEND_UNMOUNT(mp, rip, DM_RIGHT_NULL, 0, 0,
1041 unmount_event_flags); 1031 unmount_event_flags);
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
diff --git a/fs/xfs/linux-2.6/xfs_sync.h b/fs/xfs/linux-2.6/xfs_sync.h
index fcd4040c9ad1..2509db021f79 100644
--- a/fs/xfs/linux-2.6/xfs_sync.h
+++ b/fs/xfs/linux-2.6/xfs_sync.h
@@ -28,7 +28,6 @@ typedef struct bhv_vfs_sync_work {
28} bhv_vfs_sync_work_t; 28} bhv_vfs_sync_work_t;
29 29
30#define SYNC_ATTR 0x0001 /* sync attributes */ 30#define SYNC_ATTR 0x0001 /* sync attributes */
31#define SYNC_CLOSE 0x0002 /* close file system down */
32#define SYNC_DELWRI 0x0004 /* look at delayed writes */ 31#define SYNC_DELWRI 0x0004 /* look at delayed writes */
33#define SYNC_WAIT 0x0008 /* wait for i/o to complete */ 32#define SYNC_WAIT 0x0008 /* wait for i/o to complete */
34#define SYNC_BDFLUSH 0x0010 /* BDFLUSH is calling -- don't block */ 33#define SYNC_BDFLUSH 0x0010 /* BDFLUSH is calling -- don't block */