From 73abfc8218d93b3aac4dd2b9155967e48c6f2d89 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Mon, 27 Jul 2020 15:34:58 -0400 Subject: [PATCH] mmap: rename unmapped to empty, change comemnts Signed-off-by: Liam R. Howlett --- mm/mmap.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 966f2ab4ac62..7002a15e0b00 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1878,7 +1878,7 @@ static unsigned long unmapped_area(struct vm_unmapped_area_info *info) return -ENOMEM; rcu_read_lock(); - if (mas_get_unmapped_area(&mas, info->low_limit, info->high_limit - 1, + if (mas_get_empty_area(&mas, info->low_limit, info->high_limit - 1, length)) { rcu_read_unlock(); return -ENOMEM; @@ -1909,7 +1909,7 @@ static unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info) return -ENOMEM; rcu_read_lock(); - if (mas_get_unmapped_area_rev(&mas, info->low_limit, info->high_limit, + if (mas_get_empty_area_rev(&mas, info->low_limit, info->high_limit, length)) { rcu_read_unlock(); return -ENOMEM; @@ -2098,14 +2098,15 @@ get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, EXPORT_SYMBOL(get_unmapped_area); -/** - * find_vma() - Find the VMA for a given address, or the next vma. May return - * NULL in the case of no vma at addr or above +/* + * find_vma() - Find the best VMA for a given address. * @mm The mm_struct to check * @addr: The address * - * Returns: The VMA assoicated with addr, or the next vma. - * May return NULL in the case of no vma at addr or above. + * Searches the user memory map for the VMA which either contains this address + * or is the next VMA after this address. + * + * Returns: The VMA or %NULL if the address is higher than any mapping. */ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr) { @@ -2124,15 +2125,17 @@ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr) } EXPORT_SYMBOL(find_vma); -/** - * find_vma_prev() - Find the VMA for a given address, or the next vma and - * sets %pprev to the previous VMA, if any. +/* + * find_vma_prev() - Find the best VMA for a given address and the previous VMA. * @mm The mm_struct to check * @addr: The address * @pprev: The pointer to set to the previous VMA * - * Returns: The VMA associated with @addr, or the next vma. - * May return NULL in the case of no vma at addr or above. + * Searches the user memory map for the VMA which either contains this address + * or is the next VMA after this address. Sets %pprev to the previous VMA or + * NULL if this is the first VMA. + * + * Returns: The VMA or %NULL if the address is higher than any mapping. */ struct vm_area_struct * find_vma_prev(struct mm_struct *mm, unsigned long addr, -- 2.50.1