aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libfc/fc_fcp.c
diff options
context:
space:
mode:
authorVasu Dev <vasu.dev@intel.com>2009-11-03 14:47:55 -0500
committerJames Bottomley <James.Bottomley@suse.de>2009-12-04 13:01:09 -0500
commita7bbc7f40aa01eefef3d367349e1e6e87881a305 (patch)
treefa03ef233949f2d1ccd37515e3bbb890451d3666 /drivers/scsi/libfc/fc_fcp.c
parent1875f27e291d05711f15a8a3d486abfeaf385931 (diff)
[SCSI] fcoe, libfc: use single frame allocation API
Cleans up frame allocation APIs to have just single fc_frame_alloc API. Removes _fc_frame_alloc, renames __fc_frame_alloc to _fc_frame_alloc. Modifies fc_fcp_send_data for removed _fc_frame_alloc, fc_fcp_send_data was the only user of removed _fc_frame_alloc. Also Adds check in fc_frame_alloc to do mod by 4 for only non-zero len value. This patch is prep work to fix can_queue reducing in next patch. Single fc_frame_alloc API helps in fixing can_queue reducing in next patch. Signed-off-by: Vasu Dev <vasu.dev@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/libfc/fc_fcp.c')
-rw-r--r--drivers/scsi/libfc/fc_fcp.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index 970b54f653b7..567eee7b8609 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -505,18 +505,11 @@ static int fc_fcp_send_data(struct fc_fcp_pkt *fsp, struct fc_seq *seq,
505 */ 505 */
506 if (tlen % 4) 506 if (tlen % 4)
507 using_sg = 0; 507 using_sg = 0;
508 if (using_sg) { 508 fp = fc_frame_alloc(lport, using_sg ? 0 : tlen);
509 fp = _fc_frame_alloc(lport, 0); 509 if (!fp)
510 if (!fp) 510 return -ENOMEM;
511 return -ENOMEM;
512 } else {
513 fp = fc_frame_alloc(lport, tlen);
514 if (!fp)
515 return -ENOMEM;
516 511
517 data = (void *)(fr_hdr(fp)) + 512 data = fc_frame_header_get(fp) + 1;
518 sizeof(struct fc_frame_header);
519 }
520 fh_parm_offset = frame_offset; 513 fh_parm_offset = frame_offset;
521 fr_max_payload(fp) = fsp->max_payload; 514 fr_max_payload(fp) = fsp->max_payload;
522 } 515 }