hold_metapage(mp, 0); 
grab_metapage(mp); 
static void txUpdateMap(struct tblock * tblk){	struct inode *ip;	struct inode *ipimap;	lid_t lid;	struct tlock *tlck;	struct maplock *maplock;	struct pxd_lock pxdlock;	int maptype;	int k, nlock;	struct metapage *mp = NULL;	ipimap = JFS_SBI(tblk->sb)->ipimap;	maptype = (tblk->xflag & COMMIT_PMAP) ? COMMIT_PMAP : COMMIT_PWMAP;	/*	 *      update block allocation map	 *	 * update allocation state in pmap (and wmap) and	 * update lsn of the pmap page;	 */	/*	 * scan each tlock/page of transaction for block allocation/free:	 *	 * for each tlock/page of transaction, update map.	 *  ? are there tlock for pmap and pwmap at the same time ?	 */	for (lid = tblk->next; lid; lid = tlck->next) {		tlck = lid_to_tlock(lid);		if ((tlck->flag & tlckUPDATEMAP) == 0)			continue;		if (tlck->flag & tlckFREEPAGE) {			/*			 * Another thread may attempt to reuse freed space			 * immediately, so we want to get rid of the metapage			 * before anyone else has a chance to get it.			 * Lock metapage, update maps, then invalidate			 * the metapage.			 */			mp = tlck->mp;			ASSERT(mp->xflag & COMMIT_PAGE);			hold_metapage(mp, 0);		}		/*		 * extent list:		 * . in-line PXD list:		 * . out-of-line XAD list:		 */		maplock = (struct maplock *) & tlck->lock;		nlock = maplock->index;		for (k = 0; k < nlock; k++, maplock++) {			/*			 * allocate blocks in persistent map:			 *			 * blocks have been allocated from wmap at alloc time;			 */			if (maplock->flag & mlckALLOC) {				txAllocPMap(ipimap, maplock, tblk);			}			/*			 * free blocks in persistent and working map:			 * blocks will be freed in pmap and then in wmap;			 *			 * ? tblock specifies the PMAP/PWMAP based upon			 * transaction			 *			 * free blocks in persistent map:			 * blocks will be freed from wmap at last reference			 * release of the object for regular files;			 *			 * Alway free blocks from both persistent & working			 * maps for directories			 */			else {	/* (maplock->flag & mlckFREE) */				if (S_ISDIR(tlck->ip->i_mode))					txFreeMap(ipimap, maplock,						  tblk, COMMIT_PWMAP);				else					txFreeMap(ipimap, maplock,						  tblk, maptype);			}		}		if (tlck->flag & tlckFREEPAGE) {			if (!(tblk->flag & tblkGC_LAZY)) {				/* This is equivalent to txRelease */				ASSERT(mp->lid == lid);				tlck->mp->lid = 0;			}			assert(atomic_read(&mp->nohomeok) == 1);			atomic_dec(&mp->nohomeok);			discard_metapage(mp);			tlck->mp = NULL;		}	}	/*	 *      update inode allocation map	 *	 * update allocation state in pmap and	 * update lsn of the pmap page;	 * update in-memory inode flag/state	 *	 * unlock mapper/write lock	 */	if (tblk->xflag & COMMIT_CREATE) {		diUpdatePMap(ipimap, tblk->ino, FALSE, tblk);		ipimap->i_state |= I_DIRTY;		/* update persistent block allocation map		 * for the allocation of inode extent;		 */		pxdlock.flag = mlckALLOCPXD;		pxdlock.pxd = tblk->u.ixpxd;		pxdlock.index = 1;		txAllocPMap(ipimap, (struct maplock *) & pxdlock, tblk);	} else if (tblk->xflag & COMMIT_DELETE) {		ip = tblk->u.ip;		diUpdatePMap(ipimap, ip->i_ino, TRUE, tblk);		ipimap->i_state |= I_DIRTY;		iput(ip);	}}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/7fab479bebb96b1b4888bdae9b42e1fa9c5d3f38/jfs_txnmgr.c/clean/fs/jfs/jfs_txnmgr.c