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

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller 2009-06-09 00:19:10 -07:00
parent fbb398a832
commit 285e42802b

View file

@ -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,31 +95,28 @@ 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; int end;
for (; list; list = list->next) { WARN_ON(start > offset + len);
int end;
WARN_ON(start > offset + len); end = start + frag_iter->len;
copy = end - offset;
end = start + list->len; if (copy > 0) {
copy = end - offset; if (copy > len)
if (copy > 0) { copy = len;
if (copy > len) cookie = dma_skb_copy_datagram_iovec(chan, frag_iter,
copy = len; offset - start,
cookie = dma_skb_copy_datagram_iovec(chan, list, to, copy,
offset - start, to, copy, pinned_list);
pinned_list); if (cookie < 0)
if (cookie < 0) goto fault;
goto fault; len -= copy;
len -= copy; if (len == 0)
if (len == 0) goto end;
goto end; offset += copy;
offset += copy;
}
start = end;
} }
start = end;
} }
end: end: