powerpc/64s: Fix KVM interrupt using wrong save area
[linux-2.6-microblaze.git] / mm / util.c
index cd62e6f..c63c8e4 100644 (file)
--- a/mm/util.c
+++ b/mm/util.c
@@ -425,7 +425,7 @@ void arch_pick_mmap_layout(struct mm_struct *mm, struct rlimit *rlim_stack)
  * @bypass_rlim: %true if checking RLIMIT_MEMLOCK should be skipped
  *
  * Assumes @task and @mm are valid (i.e. at least one reference on each), and
- * that mmap_sem is held as writer.
+ * that mmap_lock is held as writer.
  *
  * Return:
  * * 0       on success
@@ -437,7 +437,7 @@ int __account_locked_vm(struct mm_struct *mm, unsigned long pages, bool inc,
        unsigned long locked_vm, limit;
        int ret = 0;
 
-       lockdep_assert_held_write(&mm->mmap_sem);
+       mmap_assert_write_locked(mm);
 
        locked_vm = mm->locked_vm;
        if (inc) {
@@ -481,10 +481,10 @@ int account_locked_vm(struct mm_struct *mm, unsigned long pages, bool inc)
        if (pages == 0 || !mm)
                return 0;
 
-       down_write(&mm->mmap_sem);
+       mmap_write_lock(mm);
        ret = __account_locked_vm(mm, pages, inc, current,
                                  capable(CAP_IPC_LOCK));
-       up_write(&mm->mmap_sem);
+       mmap_write_unlock(mm);
 
        return ret;
 }
@@ -501,11 +501,11 @@ unsigned long vm_mmap_pgoff(struct file *file, unsigned long addr,
 
        ret = security_mmap_file(file, prot, flag);
        if (!ret) {
-               if (down_write_killable(&mm->mmap_sem))
+               if (mmap_write_lock_killable(mm))
                        return -EINTR;
                ret = do_mmap_pgoff(file, addr, len, prot, flag, pgoff,
                                    &populate, &uf);
-               up_write(&mm->mmap_sem);
+               mmap_write_unlock(mm);
                userfaultfd_unmap_complete(mm, &uf);
                if (populate)
                        mm_populate(ret, populate);