Commit c675dce8 authored by Stephen Lord's avatar Stephen Lord Committed by Christoph Hellwig

[XFS] Move xfs_syncd code into xfs_super.c which is the only place which uses it

SGI Modid: 2.5.x-xfs:slinx:148433a
parent b32d7ca9
...@@ -125,7 +125,6 @@ xfs-y += $(addprefix linux/, \ ...@@ -125,7 +125,6 @@ xfs-y += $(addprefix linux/, \
xfs_iomap.o \ xfs_iomap.o \
xfs_iops.o \ xfs_iops.o \
xfs_lrw.o \ xfs_lrw.o \
xfs_syncd.o \
xfs_super.o \ xfs_super.o \
xfs_vfs.o \ xfs_vfs.o \
xfs_vnode.o) xfs_vnode.o)
......
...@@ -368,6 +368,61 @@ linvfs_clear_inode( ...@@ -368,6 +368,61 @@ linvfs_clear_inode(
} }
} }
#define SYNCD_FLAGS (SYNC_FSDATA|SYNC_BDFLUSH|SYNC_ATTR)
STATIC int
syncd(void *arg)
{
vfs_t *vfsp = (vfs_t *) arg;
int error;
daemonize("xfs_syncd");
vfsp->vfs_sync_task = current;
wmb();
wake_up(&vfsp->vfs_wait_sync_task);
for (;;) {
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(xfs_params.sync_interval);
if (vfsp->vfs_flag & VFS_UMOUNT)
break;
if (vfsp->vfs_flag & VFS_RDONLY);
continue;
VFS_SYNC(vfsp, SYNCD_FLAGS, NULL, error);
}
vfsp->vfs_sync_task = NULL;
wmb();
wake_up(&vfsp->vfs_wait_sync_task);
return 0;
}
STATIC int
linvfs_start_syncd(vfs_t *vfsp)
{
int pid;
pid = kernel_thread(syncd, (void *) vfsp,
CLONE_VM | CLONE_FS | CLONE_FILES);
if (pid < 0)
return pid;
wait_event(vfsp->vfs_wait_sync_task, vfsp->vfs_sync_task);
return 0;
}
STATIC void
linvfs_stop_syncd(vfs_t *vfsp)
{
vfsp->vfs_flag |= VFS_UMOUNT;
wmb();
wake_up_process(vfsp->vfs_sync_task);
wait_event(vfsp->vfs_wait_sync_task, !vfsp->vfs_sync_task);
}
STATIC void STATIC void
linvfs_put_super( linvfs_put_super(
struct super_block *sb) struct super_block *sb)
......
...@@ -104,7 +104,5 @@ extern void xfs_free_buftarg(struct pb_target *); ...@@ -104,7 +104,5 @@ extern void xfs_free_buftarg(struct pb_target *);
extern void xfs_setsize_buftarg(struct pb_target *, unsigned int, unsigned int); extern void xfs_setsize_buftarg(struct pb_target *, unsigned int, unsigned int);
extern unsigned int xfs_getsize_buftarg(struct pb_target *); extern unsigned int xfs_getsize_buftarg(struct pb_target *);
extern int linvfs_start_syncd(vfs_t *);
extern void linvfs_stop_syncd(vfs_t *);
#endif /* __XFS_SUPER_H__ */ #endif /* __XFS_SUPER_H__ */
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