/* Synchronous forces are implemented with a signal variable. All callers to force a given lsn to disk will wait on a the sv attached to the specific in-core log. When given in-core log finally completes its write to disk, that thread will wake up all threads waiting on the sv.  */
int _xfs_log_force(xfs_mount_t *mp, xfs_lsn_t lsn, uint flags, int *log_flushed)
/* Synchronous forces are implemented with a signal variable. All callers to force a given lsn to disk will wait on a the sv attached to the specific in-core log. When given in-core log finally completes its write to disk, that thread will wake up all threads waiting on the sv.  */
int _xfs_log_force(xfs_mount_t *mp, xfs_lsn_t lsn, uint flags, int *log_flushed)
{
	xlog_t		*log = mp->m_log;
	int		dummy;
	if (!log_flushed)
		log_flushed = &dummy;
	ASSERT(flags & XFS_LOG_FORCE);
	XFS_STATS_INC(xs_log_force);
	if (log->l_flags & XLOG_IO_ERROR)
		return XFS_ERROR(EIO);
	if (lsn == 0)
		return xlog_state_sync_all(log, flags, log_flushed);
	else
		return xlog_state_sync(log, lsn, flags, log_flushed);
}