mm: Deduplicate mm_get_unmapped_area()
Subsystems (2)
PATCH 1/1 mm: Deduplicate mm_get_unmapped_area()
Essentially it sets vm_flags==0 for mm_get_unmapped_area_vmflags(). Use the helper instead to dedup the lines.
Cc "Liam R. Howlett" <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Jann Horn <[email protected]>
Cc Pedro Falcato <[email protected]>
Reviewed-by Jason Gunthorpe <[email protected]>
Reviewed-by Oscar Salvador <[email protected]>
Reviewed-by Zi Yan <[email protected]>
Reviewed-by Lorenzo Stoakes <[email protected]>
Reviewed-by Pedro Falcato <[email protected]>
Signed-off-by Peter Xu <[email protected]>
--- mm/mmap.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
mm/mmap.c +2 -3
@@ -871,9 +871,8 @@ mm_get_unmapped_area(struct mm_struct *mm, struct file *file, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags) { - if (test_bit(MMF_TOPDOWN, &mm->flags)) - return arch_get_unmapped_area_topdown(file, addr, len, pgoff, flags, 0); -return arch_get_unmapped_area (file, addr, len, pgoff, flags,0 ); + return mm_get_unmapped_area_vmflags(mm, file, addr, len, + pgoff, flags, 0); }EXPORT_SYMBOL (mm_get_unmapped_area);
Signature · 1 line
2.49.0
Quoted 15 lines · Peter Xu
Essentially it sets vm_flags==0 for
mm_get_unmapped_area_vmflags(). Use the helper instead to dedup the lines.Cc "Liam R. Howlett" <[email protected]>Cc Lorenzo Stoakes <[email protected]>Cc Vlastimil Babka <[email protected]>Cc Jann Horn <[email protected]>Cc Pedro Falcato <[email protected]>Reviewed-by Jason Gunthorpe <[email protected]>Reviewed-by Oscar Salvador <[email protected]>Reviewed-by Zi Yan <[email protected]>Reviewed-by Lorenzo Stoakes <[email protected]>Reviewed-by Pedro Falcato <[email protected]>Signed-off-by Peter Xu <[email protected]>
Quoted 3 lines
---
Reviewed-by Dev Jain <[email protected]>
Quoted 25 lines · Peter Xu
Essentially it sets vm_flags==0 for
mm_get_unmapped_area_vmflags(). Use the helper instead to dedup the lines.Cc "Liam R. Howlett" <[email protected]>Cc Lorenzo Stoakes <[email protected]>Cc Vlastimil Babka <[email protected]>Cc Jann Horn <[email protected]>Cc Pedro Falcato <[email protected]>Reviewed-by Jason Gunthorpe <[email protected]>Reviewed-by Oscar Salvador <[email protected]>Reviewed-by Zi Yan <[email protected]>Reviewed-by Lorenzo Stoakes <[email protected]>Reviewed-by Pedro Falcato <[email protected]>Signed-off-by Peter Xu <[email protected]>--- mm/mmap.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)mm/mmap.c +0
-0@@ -871,9 +871,8 @@ mm_get_unmapped_area(struct mm_struct *mm, struct file *file, unsigned long addr, unsigned long len,
mm/mmap.c mm_get_unmapped_area(struct mm_struct *mm, struct file *file, · line 878
Quoted 10 lines
mm/mmap.c +2
-3unsigned long pgoff, unsigned long flags) { - if (test_bit(MMF_TOPDOWN, &mm->flags)) - return arch_get_unmapped_area_topdown(file, addr, len, pgoff, flags, 0); -return arch_get_unmapped_area (file, addr, len, pgoff, flags,0 ); +return mm_get_unmapped_area_vmflags (mm, file, addr, len, + pgoff, flags,0 ); }EXPORT_SYMBOL (mm_get_unmapped_area);
Reviewed-by Anshuman Khandual <[email protected]>