mmap locking API: use coccinelle to convert mmap_sem rwsem call sites
[linux-2.6-microblaze.git] / arch / arm64 / mm / fault.c
index df8ae73..8afb238 100644 (file)
@@ -36,7 +36,6 @@
 #include <asm/processor.h>
 #include <asm/sysreg.h>
 #include <asm/system_misc.h>
-#include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/traps.h>
 
@@ -498,11 +497,11 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
         * validly references user space from well defined areas of the code,
         * we can bug out early if this is from code which shouldn't.
         */
-       if (!down_read_trylock(&mm->mmap_sem)) {
+       if (!mmap_read_trylock(mm)) {
                if (!user_mode(regs) && !search_exception_tables(regs->pc))
                        goto no_context;
 retry:
-               down_read(&mm->mmap_sem);
+               mmap_read_lock(mm);
        } else {
                /*
                 * The above down_read_trylock() might have succeeded in which
@@ -511,7 +510,7 @@ retry:
                might_sleep();
 #ifdef CONFIG_DEBUG_VM
                if (!user_mode(regs) && !search_exception_tables(regs->pc)) {
-                       up_read(&mm->mmap_sem);
+                       mmap_read_unlock(mm);
                        goto no_context;
                }
 #endif
@@ -533,7 +532,7 @@ retry:
                        goto retry;
                }
        }
-       up_read(&mm->mmap_sem);
+       mmap_read_unlock(mm);
 
        /*
         * Handle the "normal" (no error) case first.