[1/2] mm/mmap: rename __vma_unlink_common() to __vma_unlink()
diff mbox series

Message ID 20200809232057.23477-1-richard.weiyang@linux.alibaba.com
State In Next
Commit 47cbb91f078f663e744a96629d374e70c76b89c8
Headers show
Series
  • [1/2] mm/mmap: rename __vma_unlink_common() to __vma_unlink()
Related show

Commit Message

Wei Yang Aug. 9, 2020, 11:20 p.m. UTC
__vma_unlink_common() and __vma_unlink() are counterparts. Since there is
not function named __vma_unlink(), let's rename it to __vma_unlink() to
make the code more self-explain and easy for audience to understand.

Otherwise we may expect there are several variants of vma_unlink and
__vma_unlink_common() is used by them.

Signed-off-by: Wei Yang <richard.weiyang@linux.alibaba.com>
---
 mm/mmap.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Andrew Morton Aug. 19, 2020, 8:12 p.m. UTC | #1
On Mon, 10 Aug 2020 07:20:56 +0800 Wei Yang <richard.weiyang@linux.alibaba.com> wrote:

> __vma_unlink_common() and __vma_unlink() are counterparts. Since there is

I assume you meant "__vma_link()" here?

> not function named __vma_unlink(), let's rename it to __vma_unlink() to
> make the code more self-explain and easy for audience to understand.
> 
> Otherwise we may expect there are several variants of vma_unlink and
> __vma_unlink_common() is used by them.
Wei Yang Aug. 20, 2020, 2:15 a.m. UTC | #2
On Wed, Aug 19, 2020 at 01:12:10PM -0700, Andrew Morton wrote:
>On Mon, 10 Aug 2020 07:20:56 +0800 Wei Yang <richard.weiyang@linux.alibaba.com> wrote:
>
>> __vma_unlink_common() and __vma_unlink() are counterparts. Since there is
>
>I assume you meant "__vma_link()" here?
>

Oops, my fault. You are right.

Do you prefer a v2, or you would like to fix it online?

>> not function named __vma_unlink(), let's rename it to __vma_unlink() to
>> make the code more self-explain and easy for audience to understand.
>> 
>> Otherwise we may expect there are several variants of vma_unlink and
>> __vma_unlink_common() is used by them.

Patch
diff mbox series

diff --git a/mm/mmap.c b/mm/mmap.c
index dcdab2675a21..ec780925da94 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -677,7 +677,7 @@  static void __insert_vm_struct(struct mm_struct *mm, struct vm_area_struct *vma)
 	mm->map_count++;
 }
 
-static __always_inline void __vma_unlink_common(struct mm_struct *mm,
+static __always_inline void __vma_unlink(struct mm_struct *mm,
 						struct vm_area_struct *vma,
 						struct vm_area_struct *ignore)
 {
@@ -859,7 +859,7 @@  int __vma_adjust(struct vm_area_struct *vma, unsigned long start,
 		 * us to remove next before dropping the locks.
 		 */
 		if (remove_next != 3)
-			__vma_unlink_common(mm, next, next);
+			__vma_unlink(mm, next, next);
 		else
 			/*
 			 * vma is not before next if they've been
@@ -870,7 +870,7 @@  int __vma_adjust(struct vm_area_struct *vma, unsigned long start,
 			 * "next" (which is stored in post-swap()
 			 * "vma").
 			 */
-			__vma_unlink_common(mm, next, vma);
+			__vma_unlink(mm, next, vma);
 		if (file)
 			__remove_shared_vm_struct(next, file, mapping);
 	} else if (insert) {