aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorDavid Chinner <david@fromorbit.com>2008-10-30 02:15:38 -0400
committerLachlan McIlroy <lachlan@sgi.com>2008-10-30 02:15:38 -0400
commitbe97d9d5577f6c8a36588e2f262c772c5422b128 (patch)
tree9146f1872b61ccaf77b7268680320eb213bfdcdd /fs/xfs
parentaacaa880bfac8fecd44b279a49688643890358f5 (diff)
[XFS] make SYNC_ATTR no longer use xfs_sync
Continue to de-multiplex xfs_sync be replacing all SYNC_ATTR callers with direct calls xfs_sync_inodes(). Add an assert into xfs_sync() to ensure we caught all the SYNC_ATTR callers. SGI-PV: 988140 SGI-Modid: xfs-linux-melb:xfs-kern:32308a 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')
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c3
-rw-r--r--fs/xfs/linux-2.6/xfs_sync.c23
-rw-r--r--fs/xfs/linux-2.6/xfs_sync.h1
-rw-r--r--fs/xfs/xfs_vfsops.c2
4 files changed, 14 insertions, 15 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 767f38e0e0bb..38d380a7ca23 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -998,7 +998,8 @@ xfs_fs_put_super(
998 int error; 998 int error;
999 999
1000 xfs_syncd_stop(mp); 1000 xfs_syncd_stop(mp);
1001 xfs_sync(mp, SYNC_ATTR | SYNC_DELWRI); 1001 xfs_log_force(mp, 0, XFS_LOG_FORCE|XFS_LOG_SYNC);
1002 xfs_sync_inodes(mp, SYNC_ATTR|SYNC_DELWRI);
1002 1003
1003#ifdef HAVE_DMAPI 1004#ifdef HAVE_DMAPI
1004 if (mp->m_flags & XFS_MOUNT_DMAPI) { 1005 if (mp->m_flags & XFS_MOUNT_DMAPI) {
diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c
index 3c31137cdc7f..002ccb6f0cbe 100644
--- a/fs/xfs/linux-2.6/xfs_sync.c
+++ b/fs/xfs/linux-2.6/xfs_sync.c
@@ -342,9 +342,8 @@ xfs_sync_fsdata(
342 * periodically. We also push the inodes and 342 * periodically. We also push the inodes and
343 * superblock if we can lock them without sleeping 343 * superblock if we can lock them without sleeping
344 * and they are not pinned. 344 * and they are not pinned.
345 * SYNC_ATTR - We need to flush the inodes. If SYNC_BDFLUSH is not 345 * SYNC_ATTR - We need to flush the inodes. Now handled by direct calls
346 * set, then we really want to lock each inode and flush 346 * to xfs_sync_inodes().
347 * it.
348 * SYNC_WAIT - All the flushes that take place in this call should 347 * SYNC_WAIT - All the flushes that take place in this call should
349 * be synchronous. 348 * be synchronous.
350 * SYNC_DELWRI - This tells us to push dirty pages associated with 349 * SYNC_DELWRI - This tells us to push dirty pages associated with
@@ -373,6 +372,8 @@ xfs_sync(
373 int last_error = 0; 372 int last_error = 0;
374 uint log_flags = XFS_LOG_FORCE; 373 uint log_flags = XFS_LOG_FORCE;
375 374
375 ASSERT(!(flags & SYNC_ATTR));
376
376 /* 377 /*
377 * Get the Quota Manager to flush the dquots. 378 * Get the Quota Manager to flush the dquots.
378 * 379 *
@@ -403,20 +404,18 @@ xfs_sync(
403 404
404 xfs_log_force(mp, (xfs_lsn_t)0, log_flags); 405 xfs_log_force(mp, (xfs_lsn_t)0, log_flags);
405 406
406 if (flags & (SYNC_ATTR|SYNC_DELWRI)) { 407 if (flags & SYNC_DELWRI) {
407 if (flags & SYNC_BDFLUSH) 408 if (flags & SYNC_BDFLUSH)
408 xfs_finish_reclaim_all(mp, 1, XFS_IFLUSH_DELWRI_ELSE_ASYNC); 409 xfs_finish_reclaim_all(mp, 1, XFS_IFLUSH_DELWRI_ELSE_ASYNC);
409 else 410 else
410 error = xfs_sync_inodes(mp, flags); 411 error = xfs_sync_inodes(mp, flags);
411 } 412 /*
412 413 * Flushing out dirty data above probably generated more
413 /* 414 * log activity, so if this isn't vfs_sync() then flush
414 * Flushing out dirty data above probably generated more 415 * the log again.
415 * log activity, so if this isn't vfs_sync() then flush 416 */
416 * the log again.
417 */
418 if (flags & SYNC_DELWRI)
419 xfs_log_force(mp, 0, log_flags); 417 xfs_log_force(mp, 0, log_flags);
418 }
420 419
421 if (flags & SYNC_FSDATA) { 420 if (flags & SYNC_FSDATA) {
422 error = xfs_sync_fsdata(mp, flags); 421 error = xfs_sync_fsdata(mp, flags);
diff --git a/fs/xfs/linux-2.6/xfs_sync.h b/fs/xfs/linux-2.6/xfs_sync.h
index 295486199406..5316915c0834 100644
--- a/fs/xfs/linux-2.6/xfs_sync.h
+++ b/fs/xfs/linux-2.6/xfs_sync.h
@@ -49,7 +49,6 @@ typedef struct bhv_vfs_sync_work {
49 * to disk (this is the main difference between a sync and a quiesce). 49 * to disk (this is the main difference between a sync and a quiesce).
50 */ 50 */
51#define SYNC_DATA_QUIESCE (SYNC_DELWRI|SYNC_FSDATA|SYNC_WAIT|SYNC_IOWAIT) 51#define SYNC_DATA_QUIESCE (SYNC_DELWRI|SYNC_FSDATA|SYNC_WAIT|SYNC_IOWAIT)
52#define SYNC_INODE_QUIESCE (SYNC_REMOUNT|SYNC_ATTR|SYNC_WAIT)
53 52
54int xfs_syncd_init(struct xfs_mount *mp); 53int xfs_syncd_init(struct xfs_mount *mp);
55void xfs_syncd_stop(struct xfs_mount *mp); 54void xfs_syncd_stop(struct xfs_mount *mp);
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c
index d5396d6f5170..c82b9555959b 100644
--- a/fs/xfs/xfs_vfsops.c
+++ b/fs/xfs/xfs_vfsops.c
@@ -76,7 +76,7 @@ xfs_quiesce_fs(
76 */ 76 */
77 do { 77 do {
78 xfs_log_force(mp, 0, XFS_LOG_FORCE|XFS_LOG_SYNC); 78 xfs_log_force(mp, 0, XFS_LOG_FORCE|XFS_LOG_SYNC);
79 xfs_sync_inodes(mp, SYNC_INODE_QUIESCE); 79 xfs_sync_inodes(mp, SYNC_ATTR|SYNC_WAIT);
80 pincount = xfs_flush_buftarg(mp->m_ddev_targp, 1); 80 pincount = xfs_flush_buftarg(mp->m_ddev_targp, 1);
81 if (!pincount) { 81 if (!pincount) {
82 delay(50); 82 delay(50);