diff options
author | Jason Wang <jasowang@redhat.com> | 2013-08-06 13:45:03 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-08-08 03:52:33 +0400 |
commit | b4bf07771faaf959b0a916d35b1b930c030e30a8 (patch) | |
tree | 9292ea7010fc74fb5c3f5039ee3886b1f42702f3 /drivers/net/macvtap.c | |
parent | 6261d983f226f0a6a8d4d32b57a032bc23a5ebb6 (diff) | |
download | linux-b4bf07771faaf959b0a916d35b1b930c030e30a8.tar.xz |
net: move iov_pages() to net/core/iovec.c
To let it be reused and reduce code duplication.
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/macvtap.c')
-rw-r--r-- | drivers/net/macvtap.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c index a98fb0ed6aef..dfec20df17ba 100644 --- a/drivers/net/macvtap.c +++ b/drivers/net/macvtap.c @@ -698,29 +698,6 @@ static int macvtap_skb_to_vnet_hdr(const struct sk_buff *skb, return 0; } -static unsigned long iov_pages(const struct iovec *iv, int offset, - unsigned long nr_segs) -{ - unsigned long seg, base; - int pages = 0, len, size; - - while (nr_segs && (offset >= iv->iov_len)) { - offset -= iv->iov_len; - ++iv; - --nr_segs; - } - - for (seg = 0; seg < nr_segs; seg++) { - base = (unsigned long)iv[seg].iov_base + offset; - len = iv[seg].iov_len - offset; - size = ((base & ~PAGE_MASK) + len + ~PAGE_MASK) >> PAGE_SHIFT; - pages += size; - offset = 0; - } - - return pages; -} - /* Get packet from user space buffer */ static ssize_t macvtap_get_user(struct macvtap_queue *q, struct msghdr *m, const struct iovec *iv, unsigned long total_len, |