[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>
This commit is contained in:
parent
1875f27e29
commit
a7bbc7f40a
3 changed files with 10 additions and 27 deletions
|
@ -505,18 +505,11 @@ static int fc_fcp_send_data(struct fc_fcp_pkt *fsp, struct fc_seq *seq,
|
|||
*/
|
||||
if (tlen % 4)
|
||||
using_sg = 0;
|
||||
if (using_sg) {
|
||||
fp = _fc_frame_alloc(lport, 0);
|
||||
if (!fp)
|
||||
return -ENOMEM;
|
||||
} else {
|
||||
fp = fc_frame_alloc(lport, tlen);
|
||||
if (!fp)
|
||||
return -ENOMEM;
|
||||
fp = fc_frame_alloc(lport, using_sg ? 0 : tlen);
|
||||
if (!fp)
|
||||
return -ENOMEM;
|
||||
|
||||
data = (void *)(fr_hdr(fp)) +
|
||||
sizeof(struct fc_frame_header);
|
||||
}
|
||||
data = fc_frame_header_get(fp) + 1;
|
||||
fh_parm_offset = frame_offset;
|
||||
fr_max_payload(fp) = fsp->max_payload;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue