]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - arch/x86/include/asm/pgtable_64.h
x86/mm/gup: Switch GUP to the generic get_user_page_fast() implementation
[mirror_ubuntu-bionic-kernel.git] / arch / x86 / include / asm / pgtable_64.h
index 9991224f62381ee9fe021f700da9083bceff45e7..12ea31274eb66940c4ba4cec589f631e79b3ab8a 100644 (file)
@@ -227,6 +227,20 @@ extern void cleanup_highmap(void);
 extern void init_extra_mapping_uc(unsigned long phys, unsigned long size);
 extern void init_extra_mapping_wb(unsigned long phys, unsigned long size);
 
-#endif /* !__ASSEMBLY__ */
+#define gup_fast_permitted gup_fast_permitted
+static inline bool gup_fast_permitted(unsigned long start, int nr_pages,
+               int write)
+{
+       unsigned long len, end;
+
+       len = (unsigned long)nr_pages << PAGE_SHIFT;
+       end = start + len;
+       if (end < start)
+               return false;
+       if (end >> __VIRTUAL_MASK_SHIFT)
+               return false;
+       return true;
+}
 
+#endif /* !__ASSEMBLY__ */
 #endif /* _ASM_X86_PGTABLE_64_H */