error = xfs_log_reserve(mp, 600, 1, &tic, XFS_LOG, 0); 
error = xfs_log_reserve(mp, 600, 1, &tic, XFS_LOG, 0, 0); 
xfs_log_unmount_write(xfs_mount_t *mp){	xlog_t		 *log = mp->m_log;	xlog_in_core_t	 *iclog;#ifdef DEBUG	xlog_in_core_t	 *first_iclog;#endif	xfs_log_iovec_t  reg[1];	xfs_log_ticket_t tic = NULL;	xfs_lsn_t	 lsn;	int		 error;	SPLDECL(s);	/* the data section must be 32 bit size aligned */	struct {	    __uint16_t magic;	    __uint16_t pad1;	    __uint32_t pad2; /* may as well make it 64 bits */	} magic = { XLOG_UNMOUNT_TYPE, 0, 0 };#if defined(DEBUG) || defined(XLOG_NOLOG)	if (!xlog_debug && xlog_target == log->l_targ)		return 0;#endif	/*	 * Don't write out unmount record on read-only mounts.	 * Or, if we are doing a forced umount (typically because of IO errors).	 */	if (XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY)		return 0;	xfs_log_force(mp, 0, XFS_LOG_FORCE|XFS_LOG_SYNC);#ifdef DEBUG	first_iclog = iclog = log->l_iclog;	do {		if (!(iclog->ic_state & XLOG_STATE_IOERROR)) {			ASSERT(iclog->ic_state & XLOG_STATE_ACTIVE);			ASSERT(iclog->ic_offset == 0);		}		iclog = iclog->ic_next;	} while (iclog != first_iclog);#endif	if (! (XLOG_FORCED_SHUTDOWN(log))) {		reg[0].i_addr = (void*)&magic;		reg[0].i_len  = sizeof(magic);		error = xfs_log_reserve(mp, 600, 1, &tic, XFS_LOG, 0);		if (!error) {			/* remove inited flag */			((xlog_ticket_t *)tic)->t_flags = 0;			error = xlog_write(mp, reg, 1, tic, &lsn,					   NULL, XLOG_UNMOUNT_TRANS);			/*			 * At this point, we're umounting anyway,			 * so there's no point in transitioning log state			 * to IOERROR. Just continue...			 */		}		if (error) {			xfs_fs_cmn_err(CE_ALERT, mp,				"xfs_log_unmount: unmount record failed");		}		s = LOG_LOCK(log);		iclog = log->l_iclog;		iclog->ic_refcnt++;		LOG_UNLOCK(log, s);		xlog_state_want_sync(log, iclog);		(void) xlog_state_release_iclog(log, iclog);		s = LOG_LOCK(log);		if (!(iclog->ic_state == XLOG_STATE_ACTIVE ||		      iclog->ic_state == XLOG_STATE_DIRTY)) {			if (!XLOG_FORCED_SHUTDOWN(log)) {				sv_wait(&iclog->ic_forcesema, PMEM,					&log->l_icloglock, s);			} else {				LOG_UNLOCK(log, s);			}		} else {			LOG_UNLOCK(log, s);		}		if (tic)			xlog_state_put_ticket(log, tic);	} else {		/*		 * We're already in forced_shutdown mode, couldn't		 * even attempt to write out the unmount transaction.		 *		 * Go through the motions of sync'ing and releasing		 * the iclog, even though no I/O will actually happen,		 * we need to wait for other log I/O's that may already		 * be in progress.  Do this as a separate section of		 * code so we'll know if we ever get stuck here that		 * we're in this odd situation of trying to unmount		 * a file system that went into forced_shutdown as		 * the result of an unmount..		 */		s = LOG_LOCK(log);		iclog = log->l_iclog;		iclog->ic_refcnt++;		LOG_UNLOCK(log, s);		xlog_state_want_sync(log, iclog);		(void) xlog_state_release_iclog(log, iclog);		s = LOG_LOCK(log);		if ( ! (   iclog->ic_state == XLOG_STATE_ACTIVE			|| iclog->ic_state == XLOG_STATE_DIRTY			|| iclog->ic_state == XLOG_STATE_IOERROR) ) {				sv_wait(&iclog->ic_forcesema, PMEM,					&log->l_icloglock, s);		} else {			LOG_UNLOCK(log, s);		}	}	return 0;}	/* xfs_log_unmount_write */
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/7e9c63961558092d584936a874cf3fee80002eb6/xfs_log.c/buggy/fs/xfs/xfs_log.c