scsi_buf = lpfc_get_scsi_buf(phba); 
scsi_buf = lpfc_new_scsi_buf(phba); 
lpfc_slave_alloc(struct scsi_device *sdev){	struct lpfc_hba *phba = (struct lpfc_hba *)sdev->host->hostdata[0];	struct lpfc_scsi_buf *scsi_buf = NULL;	struct fc_rport *rport = starget_to_rport(scsi_target(sdev));	uint32_t total = 0, i;	uint32_t num_to_alloc = 0;	unsigned long flags;	if (!rport || fc_remote_port_chkready(rport))		return -ENXIO;	sdev->hostdata = rport->dd_data;	/*	 * Populate the cmds_per_lun count scsi_bufs into this host's globally	 * available list of scsi buffers.  Don't allocate more than the	 * HBA limit conveyed to the midlayer via the host structure.  The	 * formula accounts for the lun_queue_depth + error handlers + 1	 * extra.  This list of scsi bufs exists for the lifetime of the driver.	 */	total = phba->total_scsi_bufs;	num_to_alloc = phba->cfg_lun_queue_depth + 2;	if (total >= phba->cfg_hba_queue_depth) {		lpfc_printf_log(phba, KERN_WARNING, LOG_FCP,				"%d:0704 At limitation of %d preallocated "				"command buffers\n", phba->brd_no, total);		return 0;	} else if (total + num_to_alloc > phba->cfg_hba_queue_depth) {		lpfc_printf_log(phba, KERN_WARNING, LOG_FCP,				"%d:0705 Allocation request of %d command "				"buffers will exceed max of %d.  Reducing "				"allocation request to %d.\n", phba->brd_no,				num_to_alloc, phba->cfg_hba_queue_depth,				(phba->cfg_hba_queue_depth - total));		num_to_alloc = phba->cfg_hba_queue_depth - total;	}	for (i = 0; i < num_to_alloc; i++) {		scsi_buf = lpfc_get_scsi_buf(phba);		if (!scsi_buf) {			lpfc_printf_log(phba, KERN_ERR, LOG_FCP,					"%d:0706 Failed to allocate command "					"buffer\n", phba->brd_no);			break;		}		spin_lock_irqsave(phba->host->host_lock, flags);		phba->total_scsi_bufs++;		list_add_tail(&scsi_buf->list, &phba->lpfc_scsi_buf_list);		spin_unlock_irqrestore(phba->host->host_lock, flags);	}	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/0bd4ca25ad2ace4aa717c83dbd4ed21c53c953cb/lpfc_scsi.c/clean/drivers/scsi/lpfc/lpfc_scsi.c