aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_sync.h
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2011-04-08 12:45:07 +1000
committerDave Chinner <david@fromorbit.com>2011-04-08 12:45:07 +1000
commitc6d09b666de11eb272326a6eb6cd3246da571014 (patch)
tree74951ec04191b47a1fb75f9e79de6c00837a7c17 /fs/xfs/linux-2.6/xfs_sync.h
parentxfs: fix extent format buffer allocation size (diff)
downloadlinux-dev-c6d09b666de11eb272326a6eb6cd3246da571014.tar.xz
linux-dev-c6d09b666de11eb272326a6eb6cd3246da571014.zip
xfs: introduce a xfssyncd workqueue
All of the work xfssyncd does is background functionality. There is no need for a thread per filesystem to do this work - it can al be managed by a global workqueue now they manage concurrency effectively. Introduce a new gglobal xfssyncd workqueue, and convert the periodic work to use this new functionality. To do this, use a delayed work construct to schedule the next running of the periodic sync work for the filesystem. When the sync work is complete, queue a new delayed work for the next running of the sync work. For laptop mode, we wait on completion for the sync works, so ensure that the sync work queuing interface can flush and wait for work to complete to enable the work queue infrastructure to replace the current sequence number and wakeup that is used. Because the sync work does non-trivial amounts of work, mark the new work queue as CPU intensive. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_sync.h')
-rw-r--r--fs/xfs/linux-2.6/xfs_sync.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/xfs/linux-2.6/xfs_sync.h b/fs/xfs/linux-2.6/xfs_sync.h
index 32ba6628290c..e3a6ad27415f 100644
--- a/fs/xfs/linux-2.6/xfs_sync.h
+++ b/fs/xfs/linux-2.6/xfs_sync.h
@@ -32,6 +32,8 @@ typedef struct xfs_sync_work {
#define SYNC_WAIT 0x0001 /* wait for i/o to complete */
#define SYNC_TRYLOCK 0x0002 /* only try to lock inodes */
+extern struct workqueue_struct *xfs_syncd_wq; /* sync workqueue */
+
int xfs_syncd_init(struct xfs_mount *mp);
void xfs_syncd_stop(struct xfs_mount *mp);