/* This function is called with hbalock held. This function Gets a new driver sglq object from the sglq list. If the list is not empty then it is successful, it returns pointer to the newly allocated sglq object else it returns NULL.  */
static struct lpfc_sglq* __lpfc_sli_get_sglq(struct lpfc_hba *phba)
/* This function is called with hbalock held. This function Gets a new driver sglq object from the sglq list. If the list is not empty then it is successful, it returns pointer to the newly allocated sglq object else it returns NULL.  */
static struct lpfc_sglq* __lpfc_sli_get_sglq(struct lpfc_hba *phba)
{
	struct list_head *lpfc_sgl_list = &phba->sli4_hba.lpfc_sgl_list;
	struct lpfc_sglq *sglq = NULL;
	uint16_t adj_xri;
	list_remove_head(lpfc_sgl_list, sglq, struct lpfc_sglq, list);
	if (!sglq)
		return NULL;
	adj_xri = sglq->sli4_xritag - phba->sli4_hba.max_cfg_param.xri_base;
	phba->sli4_hba.lpfc_sglq_active_list[adj_xri] = sglq;
	return sglq;
}