History

mmap: remove inline of vm_unmapped_area

Patch series "mm: mmap: add mmap trace point", v3. Create mmap trace file and add trace point of vm_unmapped_area(). This patch (of 2): In preparation for next patch remove inline of vm_unmapped_area and move code to mmap.c. There is no logical change. Also remove unmapped_area[_topdown] out of mm.h, there is no code calling to them.

Jaewon Kim committed 6 years ago

Commit baceaf11 parent abd69b92 files · +19 −22Browse files

Unified · Split

2 files
  1. include/linux/mm.h +1 −20
  2. mm/mmap.c +18 −2
include/linux/mm.h+1−20
@@ -2530,26 +2530,7 @@ struct vm_unmapped_area_info { · 2529 unmodified lines
25302530 unsigned long align_offset;
25312531 };
25322532
2533−extern unsigned long unmapped_area(struct vm_unmapped_area_info *info);
2534−extern unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info);
2535−
2536−/*
2537− * Search for an unmapped address range.
2538− *
2539− * We are looking for a range that:
2540− * - does not intersect with any VMA;
2541− * - is contained within the [low_limit, high_limit) interval;
2542− * - is at least the desired size.
2543− * - satisfies (begin_addr & align_mask) == (align_offset & align_mask)
2544− */
2545−static inline unsigned long
2546−vm_unmapped_area(struct vm_unmapped_area_info *info)
2547−{
2548− if (info->flags & VM_UNMAPPED_AREA_TOPDOWN)
2549− return unmapped_area_topdown(info);
2550− else
2551− return unmapped_area(info);
2552−}
2533+extern unsigned long vm_unmapped_area(struct vm_unmapped_area_info *info);
25532534
25542535 /* truncate.c */
25552536 extern void truncate_inode_pages(struct address_space *, loff_t);
mm/mmap.c+18−2
@@ -1848,7 +1848,7 @@ unacct_error: · 1847 unmodified lines
18481848 return error;
18491849 }
18501850
1851−unsigned long unmapped_area(struct vm_unmapped_area_info *info)
1851+static unsigned long unmapped_area(struct vm_unmapped_area_info *info)
18521852 {
18531853 /*
18541854 * We implement the search by looking for an rbtree node that
@@ -1951,7 +1951,7 @@ found: · 96 unmodified lines
19511951 return gap_start;
19521952 }
19531953
1954−unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info)
1954+static unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info)
19551955 {
19561956 struct mm_struct *mm = current->mm;
19571957 struct vm_area_struct *vma;
@@ -2050,6 +2050,22 @@ found_highest: · 92 unmodified lines
20502050 return gap_end;
20512051 }
20522052
2053+/*
2054+ * Search for an unmapped address range.
2055+ *
2056+ * We are looking for a range that:
2057+ * - does not intersect with any VMA;
2058+ * - is contained within the [low_limit, high_limit) interval;
2059+ * - is at least the desired size.
2060+ * - satisfies (begin_addr & align_mask) == (align_offset & align_mask)
2061+ */
2062+unsigned long vm_unmapped_area(struct vm_unmapped_area_info *info)
2063+{
2064+ if (info->flags & VM_UNMAPPED_AREA_TOPDOWN)
2065+ return unmapped_area_topdown(info);
2066+ else
2067+ return unmapped_area(info);
2068+}
20532069
20542070 #ifndef arch_get_mmap_end
20552071 #define arch_get_mmap_end(addr) (TASK_SIZE)