Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173688
b: refs/heads/master
c: 18fa11e
h: refs/heads/master
v: v3
  • Loading branch information
Chris Leech authored and James Bottomley committed Dec 4, 2009
1 parent 24d8ee5 commit f42b3bc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 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: cc0136c2e9c10e889cb36e39710c0eb10707b396
refs/heads/master: 18fa11efc279c20af5eefff2bbe814ca067e51ae
5 changes: 3 additions & 2 deletions trunk/drivers/scsi/fcoe/fcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1267,10 +1267,11 @@ int fcoe_rcv(struct sk_buff *skb, struct net_device *netdev,
*/
static inline int fcoe_start_io(struct sk_buff *skb)
{
struct sk_buff *nskb;
int rc;

skb_get(skb);
rc = dev_queue_xmit(skb);
nskb = skb_clone(skb, GFP_ATOMIC);
rc = dev_queue_xmit(nskb);
if (rc != 0)
return rc;
kfree_skb(skb);
Expand Down
20 changes: 10 additions & 10 deletions trunk/drivers/scsi/libfc/fc_fcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,13 @@ static int fc_fcp_send_data(struct fc_fcp_pkt *fsp, struct fc_seq *seq,
struct scatterlist *sg;
struct fc_frame *fp = NULL;
struct fc_lport *lport = fsp->lp;
struct page *page;
size_t remaining;
size_t t_blen;
size_t tlen;
size_t sg_bytes;
size_t frame_offset, fh_parm_offset;
size_t off;
int error;
void *data = NULL;
void *page_addr;
Expand Down Expand Up @@ -605,28 +607,26 @@ static int fc_fcp_send_data(struct fc_fcp_pkt *fsp, struct fc_seq *seq,
fh_parm_offset = frame_offset;
fr_max_payload(fp) = fsp->max_payload;
}

off = offset + sg->offset;
sg_bytes = min(tlen, sg->length - offset);
sg_bytes = min(sg_bytes,
(size_t) (PAGE_SIZE - (off & ~PAGE_MASK)));
page = sg_page(sg) + (off >> PAGE_SHIFT);
if (using_sg) {
get_page(sg_page(sg));
get_page(page);
skb_fill_page_desc(fp_skb(fp),
skb_shinfo(fp_skb(fp))->nr_frags,
sg_page(sg), sg->offset + offset,
sg_bytes);
page, off & ~PAGE_MASK, sg_bytes);
fp_skb(fp)->data_len += sg_bytes;
fr_len(fp) += sg_bytes;
fp_skb(fp)->truesize += PAGE_SIZE;
} else {
size_t off = offset + sg->offset;

/*
* The scatterlist item may be bigger than PAGE_SIZE,
* but we must not cross pages inside the kmap.
*/
sg_bytes = min(sg_bytes, (size_t) (PAGE_SIZE -
(off & ~PAGE_MASK)));
page_addr = kmap_atomic(sg_page(sg) +
(off >> PAGE_SHIFT),
KM_SOFTIRQ0);
page_addr = kmap_atomic(page, KM_SOFTIRQ0);
memcpy(data, (char *)page_addr + (off & ~PAGE_MASK),
sg_bytes);
kunmap_atomic(page_addr, KM_SOFTIRQ0);
Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/scsi/libfc/fc_frame.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,13 @@ struct fc_frame *_fc_frame_alloc(size_t len)

WARN_ON((len % sizeof(u32)) != 0);
len += sizeof(struct fc_frame_header);
skb = dev_alloc_skb(len + FC_FRAME_HEADROOM + FC_FRAME_TAILROOM);
skb = alloc_skb_fclone(len + FC_FRAME_HEADROOM + FC_FRAME_TAILROOM +
NET_SKB_PAD, GFP_ATOMIC);
if (!skb)
return NULL;
skb_reserve(skb, NET_SKB_PAD + FC_FRAME_HEADROOM);
fp = (struct fc_frame *) skb;
fc_frame_init(fp);
skb_reserve(skb, FC_FRAME_HEADROOM);
skb_put(skb, len);
return fp;
}
Expand Down

0 comments on commit f42b3bc

Please sign in to comment.