/* Every sync period we need to unpin all items, reclaim inodes, sync quota and write out the superblock. We might need to cover the log to indicate it is idle.  */
STATIC void xfs_sync_worker(struct xfs_mount *mp, void *unused)
/* Every sync period we need to unpin all items, reclaim inodes, sync quota and write out the superblock. We might need to cover the log to indicate it is idle.  */
STATIC void xfs_sync_worker(struct xfs_mount *mp, void *unused)
{
	int		error;
	if (!(mp->m_flags & XFS_MOUNT_RDONLY)) {
		xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE);
		xfs_reclaim_inodes(mp, XFS_IFLUSH_DELWRI_ELSE_ASYNC);
		error = xfs_qm_sync(mp, SYNC_TRYLOCK);
		error = xfs_sync_fsdata(mp, SYNC_TRYLOCK);
	}
	mp->m_sync_seq++;
	wake_up(&mp->m_wait_single_sync_task);
}