net: qed: fix NVMe login fails over VFs
[linux-2.6-microblaze.git] / fs / exec.c
index 02d0c5d..e6e8a9a 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -252,7 +252,7 @@ static int __bprm_mm_init(struct linux_binprm *bprm)
                return -ENOMEM;
        vma_set_anonymous(vma);
 
-       if (down_write_killable(&mm->mmap_sem)) {
+       if (mmap_write_lock_killable(mm)) {
                err = -EINTR;
                goto err_free;
        }
@@ -274,11 +274,11 @@ static int __bprm_mm_init(struct linux_binprm *bprm)
                goto err;
 
        mm->stack_vm = mm->total_vm = 1;
-       up_write(&mm->mmap_sem);
+       mmap_write_unlock(mm);
        bprm->p = vma->vm_end - sizeof(void *);
        return 0;
 err:
-       up_write(&mm->mmap_sem);
+       mmap_write_unlock(mm);
 err_free:
        bprm->vma = NULL;
        vm_area_free(vma);
@@ -763,7 +763,7 @@ int setup_arg_pages(struct linux_binprm *bprm,
                bprm->loader -= stack_shift;
        bprm->exec -= stack_shift;
 
-       if (down_write_killable(&mm->mmap_sem))
+       if (mmap_write_lock_killable(mm))
                return -EINTR;
 
        vm_flags = VM_STACK_FLAGS;
@@ -825,7 +825,7 @@ int setup_arg_pages(struct linux_binprm *bprm,
                ret = -EFAULT;
 
 out_unlock:
-       up_write(&mm->mmap_sem);
+       mmap_write_unlock(mm);
        return ret;
 }
 EXPORT_SYMBOL(setup_arg_pages);
@@ -1091,12 +1091,12 @@ static int exec_mmap(struct mm_struct *mm)
                /*
                 * Make sure that if there is a core dump in progress
                 * for the old mm, we get out and die instead of going
-                * through with the exec.  We must hold mmap_sem around
+                * through with the exec.  We must hold mmap_lock around
                 * checking core_state and changing tsk->mm.
                 */
-               down_read(&old_mm->mmap_sem);
+               mmap_read_lock(old_mm);
                if (unlikely(old_mm->core_state)) {
-                       up_read(&old_mm->mmap_sem);
+                       mmap_read_unlock(old_mm);
                        mutex_unlock(&tsk->signal->exec_update_mutex);
                        return -EINTR;
                }
@@ -1112,7 +1112,7 @@ static int exec_mmap(struct mm_struct *mm)
        vmacache_flush(tsk);
        task_unlock(tsk);
        if (old_mm) {
-               up_read(&old_mm->mmap_sem);
+               mmap_read_unlock(old_mm);
                BUG_ON(active_mm != old_mm);
                setmax_mm_hiwater_rss(&tsk->signal->maxrss, old_mm);
                mm_update_next_owner(old_mm);