]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - mm/vmalloc.c
Merge branch 'work.iov_iter' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[mirror_ubuntu-artful-kernel.git] / mm / vmalloc.c
index 0b057628a7ba5c45d722710082ce32df3f7e8e13..1dda6d8a200a899bb95874ab88d0800340c669be 100644 (file)
@@ -1579,7 +1579,7 @@ void vfree_atomic(const void *addr)
  *     have CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG, but making the calling
  *     conventions for vfree() arch-depenedent would be a really bad idea)
  *
- *     NOTE: assumes that the object at *addr has a size >= sizeof(llist_node)
+ *     NOTE: assumes that the object at @addr has a size >= sizeof(llist_node)
  */
 void vfree(const void *addr)
 {
@@ -1649,16 +1649,13 @@ void *vmap(struct page **pages, unsigned int count,
 }
 EXPORT_SYMBOL(vmap);
 
-static void *__vmalloc_node(unsigned long size, unsigned long align,
-                           gfp_t gfp_mask, pgprot_t prot,
-                           int node, const void *caller);
 static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
                                 pgprot_t prot, int node)
 {
        struct page **pages;
        unsigned int nr_pages, array_size, i;
        const gfp_t nested_gfp = (gfp_mask & GFP_RECLAIM_MASK) | __GFP_ZERO;
-       const gfp_t alloc_mask = gfp_mask | __GFP_NOWARN;
+       const gfp_t alloc_mask = gfp_mask | __GFP_HIGHMEM | __GFP_NOWARN;
 
        nr_pages = get_vm_area_size(area) >> PAGE_SHIFT;
        array_size = (nr_pages * sizeof(struct page *));
@@ -1786,8 +1783,15 @@ fail:
  *     Allocate enough pages to cover @size from the page level
  *     allocator with @gfp_mask flags.  Map them into contiguous
  *     kernel virtual space, using a pagetable protection of @prot.
+ *
+ *     Reclaim modifiers in @gfp_mask - __GFP_NORETRY, __GFP_REPEAT
+ *     and __GFP_NOFAIL are not supported
+ *
+ *     Any use of gfp flags outside of GFP_KERNEL should be consulted
+ *     with mm people.
+ *
  */
-static void *__vmalloc_node(unsigned long size, unsigned long align,
+void *__vmalloc_node(unsigned long size, unsigned long align,
                            gfp_t gfp_mask, pgprot_t prot,
                            int node, const void *caller)
 {
@@ -1802,13 +1806,6 @@ void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot)
 }
 EXPORT_SYMBOL(__vmalloc);
 
-static inline void *__vmalloc_node_flags(unsigned long size,
-                                       int node, gfp_t flags)
-{
-       return __vmalloc_node(size, 1, flags, PAGE_KERNEL,
-                                       node, __builtin_return_address(0));
-}
-
 /**
  *     vmalloc  -  allocate virtually contiguous memory
  *     @size:          allocation size
@@ -1821,7 +1818,7 @@ static inline void *__vmalloc_node_flags(unsigned long size,
 void *vmalloc(unsigned long size)
 {
        return __vmalloc_node_flags(size, NUMA_NO_NODE,
-                                   GFP_KERNEL | __GFP_HIGHMEM);
+                                   GFP_KERNEL);
 }
 EXPORT_SYMBOL(vmalloc);
 
@@ -1838,7 +1835,7 @@ EXPORT_SYMBOL(vmalloc);
 void *vzalloc(unsigned long size)
 {
        return __vmalloc_node_flags(size, NUMA_NO_NODE,
-                               GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO);
+                               GFP_KERNEL | __GFP_ZERO);
 }
 EXPORT_SYMBOL(vzalloc);
 
@@ -1855,7 +1852,7 @@ void *vmalloc_user(unsigned long size)
        void *ret;
 
        ret = __vmalloc_node(size, SHMLBA,
-                            GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO,
+                            GFP_KERNEL | __GFP_ZERO,
                             PAGE_KERNEL, NUMA_NO_NODE,
                             __builtin_return_address(0));
        if (ret) {
@@ -1879,7 +1876,7 @@ EXPORT_SYMBOL(vmalloc_user);
  */
 void *vmalloc_node(unsigned long size, int node)
 {
-       return __vmalloc_node(size, 1, GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL,
+       return __vmalloc_node(size, 1, GFP_KERNEL, PAGE_KERNEL,
                                        node, __builtin_return_address(0));
 }
 EXPORT_SYMBOL(vmalloc_node);
@@ -1899,7 +1896,7 @@ EXPORT_SYMBOL(vmalloc_node);
 void *vzalloc_node(unsigned long size, int node)
 {
        return __vmalloc_node_flags(size, node,
-                        GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO);
+                        GFP_KERNEL | __GFP_ZERO);
 }
 EXPORT_SYMBOL(vzalloc_node);
 
@@ -1921,7 +1918,7 @@ EXPORT_SYMBOL(vzalloc_node);
 
 void *vmalloc_exec(unsigned long size)
 {
-       return __vmalloc_node(size, 1, GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL_EXEC,
+       return __vmalloc_node(size, 1, GFP_KERNEL, PAGE_KERNEL_EXEC,
                              NUMA_NO_NODE, __builtin_return_address(0));
 }