Merge tag 'kvm-riscv-6.4-1' of https://github.com/kvm-riscv/linux into HEAD
[linux-2.6-microblaze.git] / mm / nommu.c
index 57ba243..f670d99 100644 (file)
@@ -36,6 +36,7 @@
 #include <linux/printk.h>
 
 #include <linux/uaccess.h>
+#include <linux/uio.h>
 #include <asm/tlb.h>
 #include <asm/tlbflush.h>
 #include <asm/mmu_context.h>
@@ -198,14 +199,13 @@ unsigned long vmalloc_to_pfn(const void *addr)
 }
 EXPORT_SYMBOL(vmalloc_to_pfn);
 
-long vread(char *buf, char *addr, unsigned long count)
+long vread_iter(struct iov_iter *iter, const char *addr, size_t count)
 {
        /* Don't allow overflow */
-       if ((unsigned long) buf + count < count)
-               count = -(unsigned long) buf;
+       if ((unsigned long) addr + count < count)
+               count = -(unsigned long) addr;
 
-       memcpy(buf, addr, count);
-       return count;
+       return copy_to_iter(addr, count, iter);
 }
 
 /*