Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[linux-2.6-microblaze.git] / drivers / vhost / scsi.c
index d9861ab..7ebf106 100644 (file)
@@ -648,14 +648,12 @@ vhost_scsi_map_to_sgl(struct vhost_scsi_cmd *cmd,
        size_t offset;
        unsigned int npages = 0;
 
-       bytes = iov_iter_get_pages(iter, pages, LONG_MAX,
+       bytes = iov_iter_get_pages2(iter, pages, LONG_MAX,
                                VHOST_SCSI_PREALLOC_UPAGES, &offset);
        /* No pages were pinned */
        if (bytes <= 0)
                return bytes < 0 ? bytes : -EFAULT;
 
-       iov_iter_advance(iter, bytes);
-
        while (bytes) {
                unsigned n = min_t(unsigned, PAGE_SIZE - offset, bytes);
                sg_set_page(sg++, pages[npages++], n, offset);