示例#1
0
/*
 * dapl_hca_unlink_ia
 *
 * Remove an ia from the hca info structure
 *
 * Input:
 *	hca_ptr
 *	ia_ptr
 *
 * Output:
 * 	none
 *
 * Returns:
 * 	none
 *
 */
void dapl_hca_unlink_ia(IN DAPL_HCA * hca_ptr, IN DAPL_IA * ia_ptr)
{
	dapl_os_lock(&hca_ptr->lock);
	/*
	 * If an error occurred when we were opening the IA it
	 * will not be linked on the list; don't unlink an unlinked
	 * list!
	 */
	if (!dapl_llist_is_empty(&hca_ptr->ia_list_head)) {
		dapl_llist_remove_entry(&hca_ptr->ia_list_head,
					&ia_ptr->hca_ia_list_entry);
	}
	dapl_os_unlock(&hca_ptr->lock);
}
示例#2
0
/*
 * dapl_sp_remove_cr
 *
 * Remove the CR from the PSP. Done prior to freeing the CR resource.
 *
 * Input:
 *	sp_ptr
 *	cr_ptr
 *
 * Output:
 * 	none
 *
 * Returns:
 * 	void
 *
 */
void
dapl_sp_remove_cr(
	IN  DAPL_SP *sp_ptr,
	IN  DAPL_CR *cr_ptr)
{
	dapl_os_lock(&sp_ptr->header.lock);

	if (dapl_llist_is_empty(&sp_ptr->cr_list_head)) {
		dapl_dbg_log(DAPL_DBG_TYPE_ERR,
		    "***dapl_sp_remove_cr: removing from empty queue! sp %p\n",
		    sp_ptr);
		dapl_os_unlock(&sp_ptr->header.lock);
		return;
	}

	(void) dapl_llist_remove_entry(&sp_ptr->cr_list_head,
	    &cr_ptr->header.ia_list_entry);
	sp_ptr->cr_list_count--;

	dapl_os_unlock(&sp_ptr->header.lock);
}