Merge branch 'stable/xen-swiotlb-0.8.6' of git://git.kernel.org/pub/scm/linux/kernel...
[pandora-kernel.git] / mm / vmalloc.c
index b7e314b..6b8889d 100644 (file)
@@ -31,6 +31,7 @@
 #include <asm/tlbflush.h>
 #include <asm/shmparam.h>
 
+bool vmap_lazy_unmap __read_mostly = true;
 
 /*** Page table manipulation functions ***/
 
@@ -502,6 +503,9 @@ static unsigned long lazy_max_pages(void)
 {
        unsigned int log;
 
+       if (!vmap_lazy_unmap)
+               return 0;
+
        log = fls(num_online_cpus());
 
        return log * (32UL * 1024 * 1024 / PAGE_SIZE);
@@ -732,7 +736,7 @@ static struct vmap_block *new_vmap_block(gfp_t gfp_mask)
                                        node, gfp_mask);
        if (unlikely(IS_ERR(va))) {
                kfree(vb);
-               return ERR_PTR(PTR_ERR(va));
+               return ERR_CAST(va);
        }
 
        err = radix_tree_preload(gfp_mask);
@@ -2437,8 +2441,11 @@ static int vmalloc_open(struct inode *inode, struct file *file)
        unsigned int *ptr = NULL;
        int ret;
 
-       if (NUMA_BUILD)
+       if (NUMA_BUILD) {
                ptr = kmalloc(nr_node_ids * sizeof(unsigned int), GFP_KERNEL);
+               if (ptr == NULL)
+                       return -ENOMEM;
+       }
        ret = seq_open(file, &vmalloc_op);
        if (!ret) {
                struct seq_file *m = file->private_data;