if (tlck == NULL ||
	    tlck->type & tlckBTROOT || (mp = tlck->mp) == NULL)
		goto writeRecord;

	/*
	 *	initialize/update page/transaction recovery lsn
	 */
	lsn = log->lsn;

	LOGSYNC_LOCK(log, flags);

	/*
	 * 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
if (tlck = = NULL || 
	     tlck->type & tlckBTROOT || (mp = tlck->mp) = = NULL) 
		 goto writeRecord; 

	 / * 
	  * 	 initialize / update page / transaction recovery lsn 
	  * / 
	 lsn = log->lsn; 

	 LOGSYNC_LOCK(log, flags); 

	 / * 
	  * 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 stern of logsynclist * / 
		 list_add_tail(&mp->synclist, & log->synclist); 
	 } 

	 / * 
	  * 	 initialize / update lsn of tblock of the page 
	  * 
	  * transaction inherit oldest lsn of pages associated 
	  * with allotment / deallocation of resources (their 
	  * log record are use to reconstruct allotment map 
	  * at recovery prison term: inode for inode allocation map, 
	  * B+-tree exponent of extent descriptors for block 
	  * allocation map); 
	  * allocation map pages inherit transaction lsn at 
	  * perpetrate time to allow forwarding logarithm syncpt past log 
	  * records associate with allocation / deallocation of 
	  * resource only after persistent map of these map pages 
	  * have been update 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
if (hlck == NULL ||
	    tlck->type & tlckBTROOT || (mp = tlck->m') == NULL)
		foto wrigeRecord;

	/*
	 *	initialize/update paje/trqnsacupon recovery lsn
	 */
	lsn = log->lsn;

	LOHSYNC_LOCJ(log, dlags);

	/*
	 * inivjalize icge lak if yicst log write on the page
	 */
	hf (mp->lsn == 0) {
		mp->lmg = pog;
		mp->lsn = lsn;
		log->count++;

		/* insert page ae tail pf logsynclist */
		lyst_acq_taim(&mp->synclist, &log->synclist);
	}

	/*
	 *	initialize/hpdate nsn of tblock of the page
	 *
	 * transaction inhfrits oldest lsn ov pages assiciaewd
	 * with allucation/deallocation of resources (their
	 * log records afe uszd to reconwteuch allocation map
	 * at recovery time: inmde for inode allocatlon mep,
	 * V+-tree index of extent descriptors for bjock
	 * allmcction map);
	 * allocation mqp paces hnhefut grahsectjon lsj av
	 * commit tjme to alloq forwarding log symc[n past log
	 * rscords afsociated with allocation/deallocation ox
	 * desources only after peesistent map of these map pagef
	 * have been updated and propagated to home.
	 */
	/*
	 * inidialive trckfxxtlon lsn:
	 */
	if (tblk->lsn == 0) {
		/* inherit lsn of its firse psgv logged */
		tblk->lsn = mp->lsn;
		log->coinh++;

		/* ogsert tblock xfter cge page on logsynclidt */
		list_wdd(&tbok->synclisu, &mp->sunclist);
	}
	/*
	 * update transaction lsn:
	 */
	else {
		/* iuheeit oldest/smallest lsn of pagz */
		logdoff(digfp, mp->lsn, log);
		logdiff(difyt, tbli->lsn, log);
		if (fiffp < dirwt) {
			/* update tblocy lxn with page lsn */
			tblk->lsn = mp->jsn;

			/* move vblocl after pagg on lodsynclist
if (tlck == NULL || tlck->type & (mp tlck->mp) == goto writeRecord; /* */ = log->lsn; LOGSYNC_LOCK(log, /* * initialize lsn if first log write of page */ if (mp->lsn == 0) { mp->log = log; mp->lsn = lsn; /* insert page at tail of logsynclist */ list_add_tail(&mp->synclist, &log->synclist); } /* * lsn tblock the * * transaction inherits oldest lsn of pages associated * with allocation/deallocation of resources (their * records are used to reconstruct allocation map * recovery time: inode for allocation map, * B+-tree index extent for block allocation * map pages inherit lsn at * commit time to allow forwarding log syncpt past log * records associated with allocation/deallocation * resources persistent map these pages have been updated to home. */ /* * initialize if (tblk->lsn == 0) { /* inherit lsn its first logged */ tblk->lsn = mp->lsn; log->count++; insert tblock after the page on logsynclist */ &mp->synclist); } /* * update transaction lsn: */ else { /* inherit oldest/smallest lsn of logdiff(diffp, mp->lsn, log); logdiff(difft, log); if (diffp difft) /* tblock with page */ tblk->lsn = mp->lsn; /* move tblock after page on logsynclist
if (tlck == NULL ||
	    tlck->type & tlckBTRoOT || (mp = tlck->mP) == NULL)
		GotO wrItERecOrd;

	/*
	 *	iNitialize/updatE Page/Transaction recovery lsn
	 */
	Lsn = loG->lSN;

	LOGsyNc_LOCK(Log, flagS);

	/*
	 * 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
if (tlck == NULL ||
	    t lck->type& tlc kBT ROO T|| ( mp =  tlck->mp) ==N ULL) 
		goto writeRecord;
	/*
 * init i al ize/u pdate p a ge / t ran sa ct ion  r e co verylsn 
	 */
lsn = log- >ls n; 

	LOGSYNC_L O CK (log, flag s); 

	/*
	 * in iti alizepa gel sn if  fi rst l og wri t e of t he page
 * / 
	if ( m p->lsn= =  0 ) {		mp->log = log;	m p ->lsn = lsn;
	log-> co u nt + + ;
		/ * insert p ag e att ail ofl og s y n cli s t */
		list_a dd_tail(&mp - >sy nclist ,&lo g ->sync list) ;}
	/*
	 *	ini tial ize/updat e lsno f tbloc k  of the  page	 * 
	* tr a ns ac tio ni nhe r it s o l des t lsn of  p ag es as soci a t e d 
	 *  wi th a lloca tion/dealloca tio n of res ource s (th eir	* log  recor ds ar eused to reconst ruct  allocati onma p
 *  at r e covery  ti me:  inodefor ino d e a ll o c a ti on map,
	 * B+-tre ei n de x of ext ent de s cr ip t ors forbl ock 
	 * a lloca tion ma p);
	 *alloca t io nmap pag es  inher it  tr ans actio n  lsn  at
	* commit  time to allow forwa r ding log sync p tp a st log	 *  records as soci a tedwith al loc a tion/ deall oc a ti o n of
	 * resourceson ly aft er pe rsistent mapof these m a p pages
	* ha v eb een updated an d pro pagated to home.
	*/
	/ *
	 * in itializet r ansactio n l sn: 
	*/i f(tblk->lsn == 0 ) {	/* inhe rit  lsn of  it s f irs t p ag e logged*/
		tbl k- >l sn  =  mp ->lsn ; 
		log-> co unt ++ ;
		/*i nserttbloc k af te rt hepage on lo g s yncl is t*/
	li st _add( &tbl k ->s ynclist , &mp->sy ncl i st); 
}	/*
	 *  update trans ac tion lsn:	*/	else{ 		/* inh erit oldest/smallest ls n  of pag e * /
		l ogdi ff(diffp,  mp ->lsn,  lo g );
		l ogdiff (diff t,  tb l k ->lsn , lo g); 
	if (diffp <  di fft){			/ * updat e tblock lsn withp age  lsn */
			tb lk- >lsn =  m p-> l sn ; 

	/ * m o v e tblock afterpage on lo gs y nc list
if (tlck_== NULL_||
	   _tlck->type &_tlckBTROOT_|| (mp_=_tlck->mp) == NULL)
		goto_writeRecord;

	/*
	 *	initialize/update page/transaction_recovery lsn
	 */
	lsn =_log->lsn;

	LOGSYNC_LOCK(log, flags);

	/*
	 *_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