LOGSYNC_LOCK(log); 
LOGSYNC_LOCK(log, flags); 
int lmLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,	  struct tlock * tlck){	int lsn;	int diffp, difft;	struct metapage *mp = NULL;	jfs_info("lmLog: log:0x%p tblk:0x%p, lrd:0x%p tlck:0x%p",		 log, tblk, lrd, tlck);	LOG_LOCK(log);	/* log by (out-of-transaction) JFS ? */	if (tblk == NULL)		goto writeRecord;	/* log from page ? */	if (tlck == NULL ||	    tlck->type & tlckBTROOT || (mp = tlck->mp) == NULL)		goto writeRecord;	/*	 *      initialize/update page/transaction recovery lsn	 */	lsn = log->lsn;	LOGSYNC_LOCK(log);	/*	 * initialize page lsn if first log write of the page	 */	if (mp->lsn == 0) {		mp->log = log;		mp->lsn = lsn;		log->count++;		/* insert page at tail of logsynclist */		list_add_tail(&mp->synclist, &log->synclist);	}	/*	 *      initialize/update lsn of tblock of the page	 *	 * transaction inherits oldest lsn of pages associated	 * with allocation/deallocation of resources (their	 * log records are used to reconstruct allocation map	 * at recovery time: inode for inode allocation map,	 * B+-tree index of extent descriptors for block	 * allocation map);	 * allocation map pages inherit transaction lsn at	 * commit time to allow forwarding log syncpt past log	 * records associated with allocation/deallocation of	 * resources only after persistent map of these map pages	 * have been updated and propagated to home.	 */	/*	 * initialize transaction lsn:	 */	if (tblk->lsn == 0) {		/* inherit lsn of its first page logged */		tblk->lsn = mp->lsn;		log->count++;		/* insert tblock after the page on logsynclist */		list_add(&tblk->synclist, &mp->synclist);	}	/*	 * update transaction lsn:	 */	else {		/* inherit oldest/smallest lsn of page */		logdiff(diffp, mp->lsn, log);		logdiff(difft, tblk->lsn, log);		if (diffp < difft) {			/* update tblock lsn with page lsn */			tblk->lsn = mp->lsn;			/* move tblock after page on logsynclist */			list_move(&tblk->synclist, &mp->synclist);		}	}	LOGSYNC_UNLOCK(log);	/*	 *      write the log record	 */      writeRecord:	lsn = lmWriteRecord(log, tblk, lrd, tlck);	/*	 * forward log syncpt if log reached next syncpt trigger	 */	logdiff(diffp, lsn, log);	if (diffp >= log->nextsync)		lsn = lmLogSync(log, 0);	/* update end-of-log lsn */	log->lsn = lsn;	LOG_UNLOCK(log);	/* return end-of-log address */	return lsn;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/7fab479bebb96b1b4888bdae9b42e1fa9c5d3f38/jfs_logmgr.c/clean/fs/jfs/jfs_logmgr.c