aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi/fc_frame.h
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 /include/scsi/fc_frame.h
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 'include/scsi/fc_frame.h')
-rw-r--r--include/scsi/fc_frame.h16
1 files changed, 3 insertions, 13 deletions
diff --git a/include/scsi/fc_frame.h b/include/scsi/fc_frame.h
index ab2f8d41761b..4d3e9c7b7c57 100644
--- a/include/scsi/fc_frame.h
+++ b/include/scsi/fc_frame.h
@@ -100,17 +100,7 @@ static inline void fc_frame_init(struct fc_frame *fp)
100} 100}
101 101
102struct fc_frame *fc_frame_alloc_fill(struct fc_lport *, size_t payload_len); 102struct fc_frame *fc_frame_alloc_fill(struct fc_lport *, size_t payload_len);
103 103struct fc_frame *_fc_frame_alloc(size_t payload_len);
104struct fc_frame *__fc_frame_alloc(size_t payload_len);
105
106/*
107 * Get frame for sending via port.
108 */
109static inline struct fc_frame *_fc_frame_alloc(struct fc_lport *dev,
110 size_t payload_len)
111{
112 return __fc_frame_alloc(payload_len);
113}
114 104
115/* 105/*
116 * Allocate fc_frame structure and buffer. Set the initial length to 106 * Allocate fc_frame structure and buffer. Set the initial length to
@@ -124,10 +114,10 @@ static inline struct fc_frame *fc_frame_alloc(struct fc_lport *dev, size_t len)
124 * Note: Since len will often be a constant multiple of 4, 114 * Note: Since len will often be a constant multiple of 4,
125 * this check will usually be evaluated and eliminated at compile time. 115 * this check will usually be evaluated and eliminated at compile time.
126 */ 116 */
127 if ((len % 4) != 0) 117 if (len && len % 4)
128 fp = fc_frame_alloc_fill(dev, len); 118 fp = fc_frame_alloc_fill(dev, len);
129 else 119 else
130 fp = _fc_frame_alloc(dev, len); 120 fp = _fc_frame_alloc(len);
131 return fp; 121 return fp;
132} 122}
133 123