Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173664
b: refs/heads/master
c: a7bbc7f
h: refs/heads/master
v: v3
  • Loading branch information
Vasu Dev authored and James Bottomley committed Dec 4, 2009
1 parent b9bc264 commit 7e65bd7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 28 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1875f27e291d05711f15a8a3d486abfeaf385931
refs/heads/master: a7bbc7f40aa01eefef3d367349e1e6e87881a305
15 changes: 4 additions & 11 deletions trunk/drivers/scsi/libfc/fc_fcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/scsi/libfc/fc_frame.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ EXPORT_SYMBOL(fc_frame_crc_check);
* Allocate a frame intended to be sent via fcoe_xmit.
* Get an sk_buff for the frame and set the length.
*/
struct fc_frame *__fc_frame_alloc(size_t len)
struct fc_frame *_fc_frame_alloc(size_t len)
{
struct fc_frame *fp;
struct sk_buff *skb;
Expand All @@ -67,7 +67,7 @@ struct fc_frame *__fc_frame_alloc(size_t len)
skb_put(skb, len);
return fp;
}
EXPORT_SYMBOL(__fc_frame_alloc);
EXPORT_SYMBOL(_fc_frame_alloc);

struct fc_frame *fc_frame_alloc_fill(struct fc_lport *lp, size_t payload_len)
{
Expand All @@ -77,7 +77,7 @@ struct fc_frame *fc_frame_alloc_fill(struct fc_lport *lp, size_t payload_len)
fill = payload_len % 4;
if (fill != 0)
fill = 4 - fill;
fp = __fc_frame_alloc(payload_len + fill);
fp = _fc_frame_alloc(payload_len + fill);
if (fp) {
memset((char *) fr_hdr(fp) + payload_len, 0, fill);
/* trim is OK, we just allocated it so there are no fragments */
Expand Down
16 changes: 3 additions & 13 deletions trunk/include/scsi/fc_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,7 @@ static inline void fc_frame_init(struct fc_frame *fp)
}

struct fc_frame *fc_frame_alloc_fill(struct fc_lport *, size_t payload_len);

struct fc_frame *__fc_frame_alloc(size_t payload_len);

/*
* Get frame for sending via port.
*/
static inline struct fc_frame *_fc_frame_alloc(struct fc_lport *dev,
size_t payload_len)
{
return __fc_frame_alloc(payload_len);
}
struct fc_frame *_fc_frame_alloc(size_t payload_len);

/*
* Allocate fc_frame structure and buffer. Set the initial length to
Expand All @@ -124,10 +114,10 @@ static inline struct fc_frame *fc_frame_alloc(struct fc_lport *dev, size_t len)
* Note: Since len will often be a constant multiple of 4,
* this check will usually be evaluated and eliminated at compile time.
*/
if ((len % 4) != 0)
if (len && len % 4)
fp = fc_frame_alloc_fill(dev, len);
else
fp = _fc_frame_alloc(dev, len);
fp = _fc_frame_alloc(len);
return fp;
}

Expand Down

0 comments on commit 7e65bd7

Please sign in to comment.