WSL2-Linux-Kernel/arch/arm64/kernel
Michel Lespinasse d8ed45c5dc mmap locking API: use coccinelle to convert mmap_sem rwsem call sites
This change converts the existing mmap_sem rwsem calls to use the new mmap
locking API instead.

The change is generated using coccinelle with the following rule:

// spatch --sp-file mmap_lock_api.cocci --in-place --include-headers --dir .

@@
expression mm;
@@
(
-init_rwsem
+mmap_init_lock
|
-down_write
+mmap_write_lock
|
-down_write_killable
+mmap_write_lock_killable
|
-down_write_trylock
+mmap_write_trylock
|
-up_write
+mmap_write_unlock
|
-downgrade_write
+mmap_write_downgrade
|
-down_read
+mmap_read_lock
|
-down_read_killable
+mmap_read_lock_killable
|
-down_read_trylock
+mmap_read_trylock
|
-up_read
+mmap_read_unlock
)
-(&mm->mmap_sem)
+(mm)

Signed-off-by: Michel Lespinasse <walken@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Reviewed-by: Laurent Dufour <ldufour@linux.ibm.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Davidlohr Bueso <dbueso@suse.de>
Cc: David Rientjes <rientjes@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Liam Howlett <Liam.Howlett@oracle.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ying Han <yinghan@google.com>
Link: http://lkml.kernel.org/r/20200520052908.204642-5-walken@google.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-06-09 09:39:14 -07:00
..
probes Merge branches 'for-next/asm' and 'for-next/insn' into for-next/bti 2020-05-05 15:19:09 +01:00
vdso arm64 updates for 5.8 2020-06-01 15:18:27 -07:00
vdso32 arm64: vdso: Fix CFI directives in sigreturn trampoline 2020-05-21 12:59:26 +01:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
Makefile arm64: Implement Shadow Call Stack 2020-05-15 16:35:50 +01:00
acpi.c mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
acpi_numa.c acpi: Create subtable parsing infrastructure 2019-04-04 18:41:12 +02:00
acpi_parking_protocol.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
alternative.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
armv8_deprecated.c sysctl: pass kernel pointers to ->proc_handler 2020-04-27 02:07:40 -04:00
asm-offsets.c ARM: 2020-06-03 15:13:47 -07:00
cacheinfo.c arm64 updates for 5.3: 2019-07-08 09:54:55 -07:00
cpu-reset.S arm64: kernel: Convert to modern annotations for assembly functions 2020-05-04 12:46:03 +01:00
cpu-reset.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
cpu_errata.c ARM: 2020-06-03 15:13:47 -07:00
cpu_ops.c arm64: Introduce get_cpu_ops() helper function 2020-03-24 17:24:19 +00:00
cpufeature.c Merge branch 'for-next/bti' into for-next/core 2020-05-28 18:00:51 +01:00
cpuidle.c arm64: Introduce get_cpu_ops() helper function 2020-03-24 17:24:19 +00:00
cpuinfo.c Merge branch 'for-next/bti' into for-next/core 2020-05-28 18:00:51 +01:00
crash_core.c arm64/crash_core: Export KERNELPACMASK in vmcoreinfo 2020-05-11 14:29:10 +01:00
crash_dump.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
debug-monitors.c arm64: Call debug_traps_init() from trap_init() to help early kgdb 2020-05-18 17:51:20 +01:00
efi-entry.S arm64 updates for 5.8 2020-06-01 15:18:27 -07:00
efi-header.S arm64 updates for 5.8 2020-06-01 15:18:27 -07:00
efi-rt-wrapper.S Merge branch 'for-next/scs' into for-next/core 2020-05-28 18:03:40 +01:00
efi.c mm/pgtable: drop pgtable_t variable from pte_fn_t functions 2019-07-12 11:05:46 -07:00
entry-common.c Merge branch 'for-next/bti' into for-next/core 2020-05-28 18:00:51 +01:00
entry-fpsimd.S arm64: kernel: Convert to modern annotations for assembly functions 2020-05-04 12:46:03 +01:00
entry-ftrace.S arm64: entry-ftrace.S: Update comment to indicate that x18 is live 2020-05-18 17:47:50 +01:00
entry.S Merge branch 'for-next/scs' into for-next/core 2020-05-28 18:03:40 +01:00
fpsimd.c sysctl: pass kernel pointers to ->proc_handler 2020-04-27 02:07:40 -04:00
ftrace.c arm64: ftrace: minimize ifdeffery 2019-11-06 14:17:36 +00:00
head.S mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
hibernate-asm.S arm64: kernel: Convert to modern annotations for assembly functions 2020-05-04 12:46:03 +01:00
hibernate.c mm: consolidate pte_index() and pte_offset_*() definitions 2020-06-09 09:39:14 -07:00
hw_breakpoint.c Printk changes for 5.5 2019-11-25 19:40:40 -08:00
hyp-stub.S arm64: kernel: Convert to modern annotations for assembly functions 2020-05-04 12:46:03 +01:00
image-vars.h arm64: rename stext to primary_entry 2020-04-28 13:55:16 +01:00
image.h arm64/efi: Move variable assignments after SECTIONS 2019-08-14 17:18:15 +01:00
insn.c Merge branch 'for-next/bti' into for-next/core 2020-05-28 18:00:51 +01:00
io.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
irq.c arm64 updates for 5.3: 2019-07-08 09:54:55 -07:00
jump_label.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
kaslr.c mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
kexec_image.c arm64: kexec_file: add crash dump support 2020-01-08 17:05:23 +00:00
kgdb.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
kuser32.S docs: arm: convert docs to ReST and rename to *.rst 2019-07-15 09:20:24 -03:00
machine_kexec.c arm64: fix the flush_icache_range arguments in machine_kexec 2020-05-11 12:02:14 +01:00
machine_kexec_file.c arm64: kexec_file: print appropriate variable 2020-04-30 21:31:22 +01:00
module-plts.c arm64: implement ftrace with regs 2019-11-06 14:17:35 +00:00
module.c arm64: implement ftrace with regs 2019-11-06 14:17:35 +00:00
module.lds arm64: ftrace: emit ftrace-mod.o contents through code 2017-12-01 13:04:59 +00:00
paravirt.c firmware: smccc: Drop smccc_version enum and use ARM_SMCCC_VERSION_1_x instead 2020-05-20 19:10:37 +01:00
pci.c PCI: Constify struct pci_ecam_ops 2020-05-01 16:28:59 +01:00
perf_callchain.c arm64: stacktrace: Factor out backtrace initialisation 2019-07-22 11:44:08 +01:00
perf_event.c arm64: perf: Add support for ARMv8.5-PMU 64-bit counters 2020-03-17 22:50:30 +00:00
perf_regs.c compat: Move compat_timespec/ timeval to compat_time.h 2018-04-19 13:29:54 +02:00
pointer_auth.c arm64: install user ptrauth keys at kernel exit time 2020-03-18 09:50:19 +00:00
process.c arm64: add loglvl to dump_backtrace() 2020-06-09 09:39:11 -07:00
psci.c arm64: psci: Reduce the waiting time for cpu_psci_cpu_kill() 2019-10-25 16:29:11 +01:00
ptrace.c mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
reloc_test_core.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
reloc_test_syms.S arm64: kernel: Convert to modern annotations for assembly functions 2020-05-04 12:46:03 +01:00
relocate_kernel.S arm64: kernel: Convert to modern annotations for assembly functions 2020-05-04 12:46:03 +01:00
return_address.c arm64: unwind: Prohibit probing on return_address() 2019-08-01 15:00:26 +01:00
scs.c scs: Move DEFINE_SCS macro into core code 2020-05-18 17:47:48 +01:00
sdei.c arm64 updates for 5.8 2020-06-01 15:18:27 -07:00
setup.c arm64: Introduce get_cpu_ops() helper function 2020-03-24 17:24:19 +00:00
signal.c arm64: Basic Branch Target Identification support 2020-03-16 17:19:48 +00:00
signal32.c arm64: signal: nofpsimd: Handle fp/simd context for signal frames 2020-01-14 17:11:46 +00:00
sigreturn32.S arm64: compat: Split kuser32 2019-04-23 18:01:57 +01:00
sleep.S Merge branch 'for-next/bti' into for-next/core 2020-05-28 18:00:51 +01:00
smccc-call.S arm64: kernel: Convert to modern annotations for assembly functions 2020-05-04 12:46:03 +01:00
smp.c mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
smp_spin_table.c arm64: prefer __section from compiler_attributes.h 2019-08-13 18:32:15 +01:00
ssbd.c Return ENODEV when the selected speculation misfeature is unsupported 2020-01-08 17:27:41 +00:00
stacktrace.c arm64: unwind: strip PAC from kernel addresses 2020-03-18 09:50:20 +00:00
suspend.c mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
sys.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
sys32.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 452 2019-06-19 17:09:08 +02:00
sys_compat.c arm64: Silence clang warning on mismatched value/register sizes 2019-10-28 09:13:21 +00:00
syscall.c arm64: Basic Branch Target Identification support 2020-03-16 17:19:48 +00:00
time.c arm64: time: Replace <linux/clk-provider.h> by <linux/of_clk.h> 2020-02-12 17:26:38 +00:00
topology.c arm64: use activity monitors for frequency invariance 2020-03-06 16:02:50 +00:00
trace-events-emulation.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
traps.c mmap locking API: use coccinelle to convert mmap_sem rwsem call sites 2020-06-09 09:39:14 -07:00
vdso.c mmap locking API: use coccinelle to convert mmap_sem rwsem call sites 2020-06-09 09:39:14 -07:00
vmlinux.lds.S mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00