Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150761
b: refs/heads/master
c: 285e428
h: refs/heads/master
i:
  150759: 6caa2c9
v: v3
  • Loading branch information
David S. Miller committed Jun 9, 2009
1 parent e884217 commit 7a8d458
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 25 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: fbb398a832086c370bce47789e155bf5a08774e9
refs/heads/master: 285e42802bb3da91102967f63fb9e28e61f7831e
46 changes: 22 additions & 24 deletions trunk/net/core/user_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ int dma_skb_copy_datagram_iovec(struct dma_chan *chan,
{
int start = skb_headlen(skb);
int i, copy = start - offset;
struct sk_buff *frag_iter;
dma_cookie_t cookie = 0;

/* Copy header. */
Expand Down Expand Up @@ -94,31 +95,28 @@ int dma_skb_copy_datagram_iovec(struct dma_chan *chan,
start = end;
}

if (skb_shinfo(skb)->frag_list) {
struct sk_buff *list = skb_shinfo(skb)->frag_list;

for (; list; list = list->next) {
int end;

WARN_ON(start > offset + len);

end = start + list->len;
copy = end - offset;
if (copy > 0) {
if (copy > len)
copy = len;
cookie = dma_skb_copy_datagram_iovec(chan, list,
offset - start, to, copy,
pinned_list);
if (cookie < 0)
goto fault;
len -= copy;
if (len == 0)
goto end;
offset += copy;
}
start = end;
skb_walk_frags(skb, frag_iter) {
int end;

WARN_ON(start > offset + len);

end = start + frag_iter->len;
copy = end - offset;
if (copy > 0) {
if (copy > len)
copy = len;
cookie = dma_skb_copy_datagram_iovec(chan, frag_iter,
offset - start,
to, copy,
pinned_list);
if (cookie < 0)
goto fault;
len -= copy;
if (len == 0)
goto end;
offset += copy;
}
start = end;
}

end:
Expand Down

0 comments on commit 7a8d458

Please sign in to comment.