diff options
author | Dave Chinner <dchinner@redhat.com> | 2012-10-08 12:56:00 +0200 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2012-10-17 18:25:06 +0200 |
commit | 7e18530bef6a18a5479690ae7e8256319ecf1300 (patch) | |
tree | 01b336aed89889bf654327346742956abe0a5d45 /fs/xfs/xfs_sync.c | |
parent | xfs: xfs_syncd_stop must die (diff) | |
download | linux-7e18530bef6a18a5479690ae7e8256319ecf1300.tar.xz linux-7e18530bef6a18a5479690ae7e8256319ecf1300.zip |
xfs: rationalise xfs_mount_wq users
Instead of starting and stopping background work on the xfs_mount_wq
all at the same time, separate them to where they really are needed
to start and stop.
The xfs_sync_worker, only needs to be started after all the mount
processing has completed successfully, while it needs to be stopped
before the log is unmounted.
The xfs_reclaim_worker is started on demand, and can be
stopped before the unmount process does it's own inode reclaim pass.
The xfs_flush_inodes work is run on demand, and so we really only
need to ensure that it has stopped running before we start
processing an unmount, freeze or remount,ro.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_sync.c')
-rw-r--r-- | fs/xfs/xfs_sync.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/fs/xfs/xfs_sync.c b/fs/xfs/xfs_sync.c index 7502f0621fb9..a68761696ab5 100644 --- a/fs/xfs/xfs_sync.c +++ b/fs/xfs/xfs_sync.c @@ -379,9 +379,9 @@ xfs_syncd_queue_sync( } /* - * Every sync period we need to unpin all items, reclaim inodes and sync - * disk quotas. We might need to cover the log to indicate that the - * filesystem is idle and not frozen. + * Every sync period we need to unpin all items in the AIL and push them to + * disk. If there is nothing dirty, then we might need to cover the log to + * indicate that the filesystem is idle and not frozen. */ void xfs_sync_worker( @@ -391,17 +391,7 @@ xfs_sync_worker( struct xfs_mount, m_sync_work); int error; - /* - * We shouldn't write/force the log if we are in the mount/unmount - * process or on a read only filesystem. The workqueue still needs to be - * active in both cases, however, because it is used for inode reclaim - * during these times. Use the MS_ACTIVE flag to avoid doing anything - * during mount. Doing work during unmount is avoided by calling - * cancel_delayed_work_sync on this work queue before tearing down - * the ail and the log in xfs_log_unmount. - */ - if (!(mp->m_super->s_flags & MS_ACTIVE) && - !(mp->m_flags & XFS_MOUNT_RDONLY)) { + if (!(mp->m_flags & XFS_MOUNT_RDONLY)) { /* dgc: errors ignored here */ if (mp->m_super->s_writers.frozen == SB_UNFROZEN && xfs_log_need_covered(mp)) @@ -409,8 +399,7 @@ xfs_sync_worker( else xfs_log_force(mp, 0); - /* start pushing all the metadata that is currently - * dirty */ + /* start pushing all the metadata that is currently dirty */ xfs_ail_push_all(mp->m_ail); } |