Skip to content

Commit

Permalink
mm: simplify filemap_nopage
Browse files Browse the repository at this point in the history
Identical block is duplicated twice: contrary to the comment, we have been
re-reading the page *twice* in filemap_nopage rather than once.

If any retry logic or anything is needed, it belongs in lower levels anyway.
Only retry once.  Linus agrees.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed May 7, 2007
1 parent 14e0729 commit a812771
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1446,30 +1446,6 @@ struct page *filemap_nopage(struct vm_area_struct *area,
majmin = VM_FAULT_MAJOR;
count_vm_event(PGMAJFAULT);
}
lock_page(page);

/* Did it get unhashed while we waited for it? */
if (!page->mapping) {
unlock_page(page);
page_cache_release(page);
goto retry_all;
}

/* Did somebody else get it up-to-date? */
if (PageUptodate(page)) {
unlock_page(page);
goto success;
}

error = mapping->a_ops->readpage(file, page);
if (!error) {
wait_on_page_locked(page);
if (PageUptodate(page))
goto success;
} else if (error == AOP_TRUNCATED_PAGE) {
page_cache_release(page);
goto retry_find;
}

/*
* Umm, take care of errors if the page isn't up-to-date.
Expand Down

0 comments on commit a812771

Please sign in to comment.