diff options
author | Vasu Dev <vasu.dev@intel.com> | 2009-11-03 14:47:55 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-12-04 13:01:09 -0500 |
commit | a7bbc7f40aa01eefef3d367349e1e6e87881a305 (patch) | |
tree | fa03ef233949f2d1ccd37515e3bbb890451d3666 /drivers/scsi/libfc/fc_frame.c | |
parent | 1875f27e291d05711f15a8a3d486abfeaf385931 (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_frame.c')
-rw-r--r-- | drivers/scsi/libfc/fc_frame.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/libfc/fc_frame.c b/drivers/scsi/libfc/fc_frame.c index 4fea369b58ee..79c956501bd9 100644 --- a/drivers/scsi/libfc/fc_frame.c +++ b/drivers/scsi/libfc/fc_frame.c | |||
@@ -51,7 +51,7 @@ EXPORT_SYMBOL(fc_frame_crc_check); | |||
51 | * Allocate a frame intended to be sent via fcoe_xmit. | 51 | * Allocate a frame intended to be sent via fcoe_xmit. |
52 | * Get an sk_buff for the frame and set the length. | 52 | * Get an sk_buff for the frame and set the length. |
53 | */ | 53 | */ |
54 | struct fc_frame *__fc_frame_alloc(size_t len) | 54 | struct fc_frame *_fc_frame_alloc(size_t len) |
55 | { | 55 | { |
56 | struct fc_frame *fp; | 56 | struct fc_frame *fp; |
57 | struct sk_buff *skb; | 57 | struct sk_buff *skb; |
@@ -67,7 +67,7 @@ struct fc_frame *__fc_frame_alloc(size_t len) | |||
67 | skb_put(skb, len); | 67 | skb_put(skb, len); |
68 | return fp; | 68 | return fp; |
69 | } | 69 | } |
70 | EXPORT_SYMBOL(__fc_frame_alloc); | 70 | EXPORT_SYMBOL(_fc_frame_alloc); |
71 | 71 | ||
72 | struct fc_frame *fc_frame_alloc_fill(struct fc_lport *lp, size_t payload_len) | 72 | struct fc_frame *fc_frame_alloc_fill(struct fc_lport *lp, size_t payload_len) |
73 | { | 73 | { |
@@ -77,7 +77,7 @@ struct fc_frame *fc_frame_alloc_fill(struct fc_lport *lp, size_t payload_len) | |||
77 | fill = payload_len % 4; | 77 | fill = payload_len % 4; |
78 | if (fill != 0) | 78 | if (fill != 0) |
79 | fill = 4 - fill; | 79 | fill = 4 - fill; |
80 | fp = __fc_frame_alloc(payload_len + fill); | 80 | fp = _fc_frame_alloc(payload_len + fill); |
81 | if (fp) { | 81 | if (fp) { |
82 | memset((char *) fr_hdr(fp) + payload_len, 0, fill); | 82 | memset((char *) fr_hdr(fp) + payload_len, 0, fill); |
83 | /* trim is OK, we just allocated it so there are no fragments */ | 83 | /* trim is OK, we just allocated it so there are no fragments */ |