mm: drop mmap_sem before calling balance_dirty_pages() in write fault
[linux-2.6-microblaze.git] / mm / filemap.c
index dc3b78d..bf6aa30 100644 (file)
@@ -2329,27 +2329,6 @@ EXPORT_SYMBOL(generic_file_read_iter);
 
 #ifdef CONFIG_MMU
 #define MMAP_LOTSAMISS  (100)
-static struct file *maybe_unlock_mmap_for_io(struct vm_fault *vmf,
-                                            struct file *fpin)
-{
-       int flags = vmf->flags;
-
-       if (fpin)
-               return fpin;
-
-       /*
-        * FAULT_FLAG_RETRY_NOWAIT means we don't want to wait on page locks or
-        * anything, so we only pin the file and drop the mmap_sem if only
-        * FAULT_FLAG_ALLOW_RETRY is set.
-        */
-       if ((flags & (FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_RETRY_NOWAIT)) ==
-           FAULT_FLAG_ALLOW_RETRY) {
-               fpin = get_file(vmf->vma->vm_file);
-               up_read(&vmf->vma->vm_mm->mmap_sem);
-       }
-       return fpin;
-}
-
 /*
  * lock_page_maybe_drop_mmap - lock the page, possibly dropping the mmap_sem
  * @vmf - the vm_fault for this fault.