if ((error = xfs_bmap_finish(&tp, &flist, firstblock, &committed))) { 
/* * xfs_bmap_finish() may commit the current transaction and * start a second transaction if the freelist is not empty. * * Since we still want to modify this buffer, we need to * ensure that the buffer is not released on commit of * the first transaction and ensure the buffer is added to the * second transaction. * * If there is only one transaction then don't stop the buffer * from being released when it commits later on. */  xfs_trans_bhold(tp, bp);  if ((error = xfs_bmap_finish(tpp, &flist, firstblock, &committed))) { 
xfs_qm_dqalloc(	xfs_trans_t	*tp,	xfs_mount_t	*mp,	xfs_dquot_t	*dqp,	xfs_inode_t	*quotip,	xfs_fileoff_t	offset_fsb,	xfs_buf_t	**O_bpp){	xfs_fsblock_t	firstblock;	xfs_bmap_free_t flist;	xfs_bmbt_irec_t map;	int		nmaps, error, committed;	xfs_buf_t	*bp;	ASSERT(tp != NULL);	xfs_dqtrace_entry(dqp, "DQALLOC");	/*	 * Initialize the bmap freelist prior to calling bmapi code.	 */	XFS_BMAP_INIT(&flist, &firstblock);	xfs_ilock(quotip, XFS_ILOCK_EXCL);	/*	 * Return if this type of quotas is turned off while we didn't	 * have an inode lock	 */	if (XFS_IS_THIS_QUOTA_OFF(dqp)) {		xfs_iunlock(quotip, XFS_ILOCK_EXCL);		return (ESRCH);	}	/*	 * xfs_trans_commit normally decrements the vnode ref count	 * when it unlocks the inode. Since we want to keep the quota	 * inode around, we bump the vnode ref count now.	 */	VN_HOLD(XFS_ITOV(quotip));	xfs_trans_ijoin(tp, quotip, XFS_ILOCK_EXCL);	nmaps = 1;	if ((error = xfs_bmapi(tp, quotip,			      offset_fsb, XFS_DQUOT_CLUSTER_SIZE_FSB,			      XFS_BMAPI_METADATA | XFS_BMAPI_WRITE,			      &firstblock,			      XFS_QM_DQALLOC_SPACE_RES(mp),			      &map, &nmaps, &flist))) {		goto error0;	}	ASSERT(map.br_blockcount == XFS_DQUOT_CLUSTER_SIZE_FSB);	ASSERT(nmaps == 1);	ASSERT((map.br_startblock != DELAYSTARTBLOCK) &&	       (map.br_startblock != HOLESTARTBLOCK));	/*	 * Keep track of the blkno to save a lookup later	 */	dqp->q_blkno = XFS_FSB_TO_DADDR(mp, map.br_startblock);	/* now we can just get the buffer (there's nothing to read yet) */	bp = xfs_trans_get_buf(tp, mp->m_ddev_targp,			       dqp->q_blkno,			       XFS_QI_DQCHUNKLEN(mp),			       0);	if (!bp || (error = XFS_BUF_GETERROR(bp)))		goto error1;	/*	 * Make a chunk of dquots out of this buffer and log	 * the entire thing.	 */	xfs_qm_init_dquot_blk(tp, mp, INT_GET(dqp->q_core.d_id, ARCH_CONVERT),			      dqp->dq_flags & XFS_DQ_ALLTYPES, bp);	if ((error = xfs_bmap_finish(&tp, &flist, firstblock, &committed))) {		goto error1;	}	*O_bpp = bp;	return 0;      error1:	xfs_bmap_cancel(&flist);      error0:	xfs_iunlock(quotip, XFS_ILOCK_EXCL);	return (error);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/efa092f3d4c60be7e81de515db9f06e5f8426afc/xfs_dquot.c/clean/fs/xfs/quota/xfs_dquot.c