]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/net/tun.c
net: move iov_pages() to net/core/iovec.c
[mirror_ubuntu-bionic-kernel.git] / drivers / net / tun.c
index 5dce262f538ecc8bfb46df05d33e54c5577299dd..18527ef0cc7521cc29c0b96ad8b8203c694e2c23 100644 (file)
@@ -1041,29 +1041,6 @@ static int zerocopy_sg_from_iovec(struct sk_buff *skb, const struct iovec *from,
        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 tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
                            void *msg_control, const struct iovec *iv,