Re: [PATCH v6 10/12] mmap locking API: rename mmap_sem to mmap_lock

From: youling 257
Date: Thu Jun 04 2020 - 00:35:17 EST


I have build error about kernel/sys.c,


kernel/sys.c: In function âprctl_set_vmaâ:

kernel/sys.c:2392:18: error:

âstruct mm_structâ has no member named âmmap_semâ; did you mean

âmmap_baseâ?

2392 | down_write(&mm->mmap_sem);

| ^~~~~~~~

| mmap_base

kernel/sys.c:2402:16: error:

âstruct mm_structâ has no member named âmmap_semâ; did you mean

âmmap_baseâ?

2402 | up_write(&mm->mmap_sem);

| ^~~~~~~~

| mmap_base



why not rename kernel/sys.c mmap_sem to mmap_lock?


diff --git a/kernel/sys.c b/kernel/sys.c

index 113955fe1c6b..043c04a745a9 100644

--- a/kernel/sys.c

+++ b/kernel/sys.c

@@ -2389,7 +2389,7 @@ static int prctl_set_vma(unsigned long opt,
unsigned long start,

if (end == start)

return 0;

- down_write(&mm->mmap_sem);

+ down_write(&mm->mmap_lock);

switch (opt) {

case PR_SET_VMA_ANON_NAME:

@@ -2399,7 +2399,7 @@ static int prctl_set_vma(unsigned long opt,
unsigned long start,

error = -EINVAL;

}

- up_write(&mm->mmap_sem);

+ up_write(&mm->mmap_lock);

return error;

}