mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
net/core/user_dma.c: Use frag list abstraction interfaces.
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
fbb398a832
commit
285e42802b
1 changed files with 20 additions and 22 deletions
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue