nommu: don't need get_unmapped_area() for NOMMU

get_unmapped_area() is unnecessary for NOMMU as no-one calls it.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Greg Ungerer <gerg@snapgear.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by David Howells and committed by Linus Torvalds efc1a3b1 779c1023

+8 -24
+2
include/linux/mm_types.h
··· 205 struct vm_area_struct * mmap; /* list of VMAs */ 206 struct rb_root mm_rb; 207 struct vm_area_struct * mmap_cache; /* last find_vma result */ 208 unsigned long (*get_unmapped_area) (struct file *filp, 209 unsigned long addr, unsigned long len, 210 unsigned long pgoff, unsigned long flags); 211 void (*unmap_area) (struct mm_struct *mm, unsigned long addr); 212 unsigned long mmap_base; /* base of mmap area */ 213 unsigned long task_size; /* size of task vm space */ 214 unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */
··· 205 struct vm_area_struct * mmap; /* list of VMAs */ 206 struct rb_root mm_rb; 207 struct vm_area_struct * mmap_cache; /* last find_vma result */ 208 + #ifdef CONFIG_MMU 209 unsigned long (*get_unmapped_area) (struct file *filp, 210 unsigned long addr, unsigned long len, 211 unsigned long pgoff, unsigned long flags); 212 void (*unmap_area) (struct mm_struct *mm, unsigned long addr); 213 + #endif 214 unsigned long mmap_base; /* base of mmap area */ 215 unsigned long task_size; /* size of task vm space */ 216 unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */
+5 -2
include/linux/sched.h
··· 377 378 #include <linux/aio.h> 379 380 extern unsigned long 381 arch_get_unmapped_area(struct file *, unsigned long, unsigned long, 382 unsigned long, unsigned long); ··· 388 unsigned long flags); 389 extern void arch_unmap_area(struct mm_struct *, unsigned long); 390 extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); 391 392 #if USE_SPLIT_PTLOCKS 393 /* ··· 2495 } 2496 2497 #endif /* CONFIG_SMP */ 2498 - 2499 - extern void arch_pick_mmap_layout(struct mm_struct *mm); 2500 2501 #ifdef CONFIG_TRACING 2502 extern void
··· 377 378 #include <linux/aio.h> 379 380 + #ifdef CONFIG_MMU 381 + extern void arch_pick_mmap_layout(struct mm_struct *mm); 382 extern unsigned long 383 arch_get_unmapped_area(struct file *, unsigned long, unsigned long, 384 unsigned long, unsigned long); ··· 386 unsigned long flags); 387 extern void arch_unmap_area(struct mm_struct *, unsigned long); 388 extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); 389 + #else 390 + static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} 391 + #endif 392 393 #if USE_SPLIT_PTLOCKS 394 /* ··· 2490 } 2491 2492 #endif /* CONFIG_SMP */ 2493 2494 #ifdef CONFIG_TRACING 2495 extern void
-21
mm/nommu.c
··· 1761 EXPORT_SYMBOL(unmap_mapping_range); 1762 1763 /* 1764 - * ask for an unmapped area at which to create a mapping on a file 1765 - */ 1766 - unsigned long get_unmapped_area(struct file *file, unsigned long addr, 1767 - unsigned long len, unsigned long pgoff, 1768 - unsigned long flags) 1769 - { 1770 - unsigned long (*get_area)(struct file *, unsigned long, unsigned long, 1771 - unsigned long, unsigned long); 1772 - 1773 - get_area = current->mm->get_unmapped_area; 1774 - if (file && file->f_op && file->f_op->get_unmapped_area) 1775 - get_area = file->f_op->get_unmapped_area; 1776 - 1777 - if (!get_area) 1778 - return -ENOSYS; 1779 - 1780 - return get_area(file, addr, len, pgoff, flags); 1781 - } 1782 - EXPORT_SYMBOL(get_unmapped_area); 1783 - 1784 - /* 1785 * Check that a process has enough memory to allocate a new virtual 1786 * mapping. 0 means there is enough memory for the allocation to 1787 * succeed and -ENOMEM implies there is not.
··· 1761 EXPORT_SYMBOL(unmap_mapping_range); 1762 1763 /* 1764 * Check that a process has enough memory to allocate a new virtual 1765 * mapping. 0 means there is enough memory for the allocation to 1766 * succeed and -ENOMEM implies there is not.
+1 -1
mm/util.c
··· 220 } 221 EXPORT_SYMBOL(strndup_user); 222 223 - #ifndef HAVE_ARCH_PICK_MMAP_LAYOUT 224 void arch_pick_mmap_layout(struct mm_struct *mm) 225 { 226 mm->mmap_base = TASK_UNMAPPED_BASE;
··· 220 } 221 EXPORT_SYMBOL(strndup_user); 222 223 + #if defined(CONFIG_MMU) && !defined(HAVE_ARCH_PICK_MMAP_LAYOUT) 224 void arch_pick_mmap_layout(struct mm_struct *mm) 225 { 226 mm->mmap_base = TASK_UNMAPPED_BASE;