From: Davidlohr Bueso <d...@stgolabs.net>

This becomes quite straightforward with the mmrange in place.

Signed-off-by: Davidlohr Bueso <dbu...@suse.de>
---
 arch/unicore32/mm/fault.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/unicore32/mm/fault.c b/arch/unicore32/mm/fault.c
index dd35b6191798..f806ade79afd 100644
--- a/arch/unicore32/mm/fault.c
+++ b/arch/unicore32/mm/fault.c
@@ -233,12 +233,12 @@ static int do_pf(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 (!mm_read_trylock(mm, &mmrange)) {
                if (!user_mode(regs)
                    && !search_exception_tables(regs->UCreg_pc))
                        goto no_context;
 retry:
-               down_read(&mm->mmap_sem);
+               mm_read_lock(mm, &mmrange);
        } else {
                /*
                 * The above down_read_trylock() might have succeeded in
@@ -275,7 +275,7 @@ static int do_pf(unsigned long addr, unsigned int fsr, 
struct pt_regs *regs)
                }
        }
 
-       up_read(&mm->mmap_sem);
+       mm_read_unlock(mm, &mmrange);
 
        /*
         * Handle the "normal" case first - VM_FAULT_MAJOR
-- 
2.13.6

Reply via email to