vmalloc: pcpu_get/free_vm_areas() aren't needed on UP
authorTejun Heo <tj@kernel.org>
Fri, 3 Sep 2010 16:22:47 +0000 (18:22 +0200)
committerPekka Enberg <penberg@kernel.org>
Sat, 2 Oct 2010 07:25:25 +0000 (10:25 +0300)
These functions are used only by percpu memory allocator on SMP.
Don't build them on UP.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Nick Piggin <npiggin@kernel.dk>
include/linux/vmalloc.h
mm/vmalloc.c

index 01c2145118dc53bd831eaad32255e058b8db3dcd..63a4fe6d51bd68277634943cb062dc4ea62fced1 100644 (file)
@@ -117,10 +117,12 @@ extern rwlock_t vmlist_lock;
 extern struct vm_struct *vmlist;
 extern __init void vm_area_register_early(struct vm_struct *vm, size_t align);
 
+#ifdef CONFIG_SMP
 struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets,
                                     const size_t *sizes, int nr_vms,
                                     size_t align, gfp_t gfp_mask);
 
 void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms);
+#endif
 
 #endif /* _LINUX_VMALLOC_H */
index 6b8889da69a60612301c2bd26244ae0f3e1e1966..c623e0ce3f0037614c68aff82be764f11b6f0148 100644 (file)
@@ -2056,6 +2056,7 @@ void free_vm_area(struct vm_struct *area)
 }
 EXPORT_SYMBOL_GPL(free_vm_area);
 
+#ifdef CONFIG_SMP
 static struct vmap_area *node_to_va(struct rb_node *n)
 {
        return n ? rb_entry(n, struct vmap_area, rb_node) : NULL;
@@ -2336,6 +2337,7 @@ void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms)
                free_vm_area(vms[i]);
        kfree(vms);
 }
+#endif /* CONFIG_SMP */
 
 #ifdef CONFIG_PROC_FS
 static void *s_start(struct seq_file *m, loff_t *pos)