/* If the buffer does not yet have a buf log item associated with it, then allocate one for it. Then add the buf item to the transaction.  */
void xfs_trans_bjoin(xfs_trans_t *tp, xfs_buf_t *bp)
/* If the buffer does not yet have a buf log item associated with it, then allocate one for it. Then add the buf item to the transaction.  */
void xfs_trans_bjoin(xfs_trans_t *tp, xfs_buf_t *bp)
{
	xfs_buf_log_item_t	*bip;
	ASSERT(XFS_BUF_ISBUSY(bp));
	ASSERT(XFS_BUF_FSPRIVATE2(bp, void *) == NULL);
	xfs_buf_item_init(bp, tp->t_mountp);
	bip = XFS_BUF_FSPRIVATE(bp, xfs_buf_log_item_t *);
	ASSERT(!(bip->bli_flags & XFS_BLI_STALE));
	ASSERT(!(bip->bli_format.blf_flags & XFS_BLI_CANCEL));
	ASSERT(!(bip->bli_flags & XFS_BLI_LOGGED));
	atomic_inc(&bip->bli_refcount);
	(void) xfs_trans_add_item(tp, (xfs_log_item_t *)bip);
	XFS_BUF_SET_FSPRIVATE2(bp, tp);
	trace_xfs_trans_bjoin(bip);
}