Commit be97d9d5 authored by David Chinner's avatar David Chinner Committed by Lachlan McIlroy

[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: default avatarDavid Chinner <david@fromorbit.com>
Signed-off-by: default avatarLachlan McIlroy <lachlan@sgi.com>
Signed-off-by: default avatarChristoph Hellwig <hch@infradead.org>
parent aacaa880
...@@ -998,7 +998,8 @@ xfs_fs_put_super( ...@@ -998,7 +998,8 @@ xfs_fs_put_super(
int error; int error;
xfs_syncd_stop(mp); xfs_syncd_stop(mp);
xfs_sync(mp, SYNC_ATTR | SYNC_DELWRI); xfs_log_force(mp, 0, XFS_LOG_FORCE|XFS_LOG_SYNC);
xfs_sync_inodes(mp, SYNC_ATTR|SYNC_DELWRI);
#ifdef HAVE_DMAPI #ifdef HAVE_DMAPI
if (mp->m_flags & XFS_MOUNT_DMAPI) { if (mp->m_flags & XFS_MOUNT_DMAPI) {
......
...@@ -342,9 +342,8 @@ xfs_sync_fsdata( ...@@ -342,9 +342,8 @@ xfs_sync_fsdata(
* periodically. We also push the inodes and * periodically. We also push the inodes and
* superblock if we can lock them without sleeping * superblock if we can lock them without sleeping
* and they are not pinned. * and they are not pinned.
* SYNC_ATTR - We need to flush the inodes. If SYNC_BDFLUSH is not * SYNC_ATTR - We need to flush the inodes. Now handled by direct calls
* set, then we really want to lock each inode and flush * to xfs_sync_inodes().
* it.
* SYNC_WAIT - All the flushes that take place in this call should * SYNC_WAIT - All the flushes that take place in this call should
* be synchronous. * be synchronous.
* SYNC_DELWRI - This tells us to push dirty pages associated with * SYNC_DELWRI - This tells us to push dirty pages associated with
...@@ -373,6 +372,8 @@ xfs_sync( ...@@ -373,6 +372,8 @@ xfs_sync(
int last_error = 0; int last_error = 0;
uint log_flags = XFS_LOG_FORCE; uint log_flags = XFS_LOG_FORCE;
ASSERT(!(flags & SYNC_ATTR));
/* /*
* Get the Quota Manager to flush the dquots. * Get the Quota Manager to flush the dquots.
* *
...@@ -403,20 +404,18 @@ xfs_sync( ...@@ -403,20 +404,18 @@ xfs_sync(
xfs_log_force(mp, (xfs_lsn_t)0, log_flags); xfs_log_force(mp, (xfs_lsn_t)0, log_flags);
if (flags & (SYNC_ATTR|SYNC_DELWRI)) { if (flags & SYNC_DELWRI) {
if (flags & SYNC_BDFLUSH) if (flags & SYNC_BDFLUSH)
xfs_finish_reclaim_all(mp, 1, XFS_IFLUSH_DELWRI_ELSE_ASYNC); xfs_finish_reclaim_all(mp, 1, XFS_IFLUSH_DELWRI_ELSE_ASYNC);
else else
error = xfs_sync_inodes(mp, flags); error = xfs_sync_inodes(mp, flags);
} /*
* Flushing out dirty data above probably generated more
/* * log activity, so if this isn't vfs_sync() then flush
* Flushing out dirty data above probably generated more * the log again.
* log activity, so if this isn't vfs_sync() then flush */
* the log again.
*/
if (flags & SYNC_DELWRI)
xfs_log_force(mp, 0, log_flags); xfs_log_force(mp, 0, log_flags);
}
if (flags & SYNC_FSDATA) { if (flags & SYNC_FSDATA) {
error = xfs_sync_fsdata(mp, flags); error = xfs_sync_fsdata(mp, flags);
......
...@@ -49,7 +49,6 @@ typedef struct bhv_vfs_sync_work { ...@@ -49,7 +49,6 @@ typedef struct bhv_vfs_sync_work {
* to disk (this is the main difference between a sync and a quiesce). * to disk (this is the main difference between a sync and a quiesce).
*/ */
#define SYNC_DATA_QUIESCE (SYNC_DELWRI|SYNC_FSDATA|SYNC_WAIT|SYNC_IOWAIT) #define SYNC_DATA_QUIESCE (SYNC_DELWRI|SYNC_FSDATA|SYNC_WAIT|SYNC_IOWAIT)
#define SYNC_INODE_QUIESCE (SYNC_REMOUNT|SYNC_ATTR|SYNC_WAIT)
int xfs_syncd_init(struct xfs_mount *mp); int xfs_syncd_init(struct xfs_mount *mp);
void xfs_syncd_stop(struct xfs_mount *mp); void xfs_syncd_stop(struct xfs_mount *mp);
......
...@@ -76,7 +76,7 @@ xfs_quiesce_fs( ...@@ -76,7 +76,7 @@ xfs_quiesce_fs(
*/ */
do { do {
xfs_log_force(mp, 0, XFS_LOG_FORCE|XFS_LOG_SYNC); xfs_log_force(mp, 0, XFS_LOG_FORCE|XFS_LOG_SYNC);
xfs_sync_inodes(mp, SYNC_INODE_QUIESCE); xfs_sync_inodes(mp, SYNC_ATTR|SYNC_WAIT);
pincount = xfs_flush_buftarg(mp->m_ddev_targp, 1); pincount = xfs_flush_buftarg(mp->m_ddev_targp, 1);
if (!pincount) { if (!pincount) {
delay(50); delay(50);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment