Commit 285e4280 authored by David S. Miller's avatar David S. Miller

net/core/user_dma.c: Use frag list abstraction interfaces.

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fbb398a8
...@@ -51,6 +51,7 @@ int dma_skb_copy_datagram_iovec(struct dma_chan *chan, ...@@ -51,6 +51,7 @@ int dma_skb_copy_datagram_iovec(struct dma_chan *chan,
{ {
int start = skb_headlen(skb); int start = skb_headlen(skb);
int i, copy = start - offset; int i, copy = start - offset;
struct sk_buff *frag_iter;
dma_cookie_t cookie = 0; dma_cookie_t cookie = 0;
/* Copy header. */ /* Copy header. */
...@@ -94,21 +95,19 @@ int dma_skb_copy_datagram_iovec(struct dma_chan *chan, ...@@ -94,21 +95,19 @@ int dma_skb_copy_datagram_iovec(struct dma_chan *chan,
start = end; start = end;
} }
if (skb_shinfo(skb)->frag_list) { skb_walk_frags(skb, frag_iter) {
struct sk_buff *list = skb_shinfo(skb)->frag_list;
for (; list; list = list->next) {
int end; int end;
WARN_ON(start > offset + len); WARN_ON(start > offset + len);
end = start + list->len; end = start + frag_iter->len;
copy = end - offset; copy = end - offset;
if (copy > 0) { if (copy > 0) {
if (copy > len) if (copy > len)
copy = len; copy = len;
cookie = dma_skb_copy_datagram_iovec(chan, list, cookie = dma_skb_copy_datagram_iovec(chan, frag_iter,
offset - start, to, copy, offset - start,
to, copy,
pinned_list); pinned_list);
if (cookie < 0) if (cookie < 0)
goto fault; goto fault;
...@@ -119,7 +118,6 @@ int dma_skb_copy_datagram_iovec(struct dma_chan *chan, ...@@ -119,7 +118,6 @@ int dma_skb_copy_datagram_iovec(struct dma_chan *chan,
} }
start = end; start = end;
} }
}
end: end:
if (!len) { if (!len) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment