mmap locking API: use coccinelle to convert mmap_sem rwsem call sites
[linux-block.git] / arch / arm / mm / fault.c
index ff230e9affc49ce0f70531adcb96b32f13715ecd..8e56c43981b46dc3709e3712f025b6e19b86a5d6 100644 (file)
@@ -18,7 +18,6 @@
 #include <linux/highmem.h>
 #include <linux/perf_event.h>
 
-#include <asm/pgtable.h>
 #include <asm/system_misc.h>
 #include <asm/system_info.h>
 #include <asm/tlbflush.h>
@@ -272,11 +271,11 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
         * 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->ARM_pc))
                        goto no_context;
 retry:
-               down_read(&mm->mmap_sem);
+               mmap_read_lock(mm);
        } else {
                /*
                 * The above down_read_trylock() might have succeeded in
@@ -326,7 +325,7 @@ retry:
                }
        }
 
-       up_read(&mm->mmap_sem);
+       mmap_read_unlock(mm);
 
        /*
         * Handle the "normal" case first - VM_FAULT_MAJOR