Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263835
b: refs/heads/master
c: cc39c6a
h: refs/heads/master
i:
  263833: e5a9080
  263831: cb9693e
v: v3
  • Loading branch information
Shaohua Li authored and Linus Torvalds committed Sep 15, 2011
1 parent 206b650 commit f26b6d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4f5b04800a224aadb6cffcbbc3d3fa26e2367c7f
refs/heads/master: cc39c6a9bbdebfcf1a7dee64d83bf302bc38d941
6 changes: 4 additions & 2 deletions trunk/mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -827,13 +827,14 @@ unsigned find_get_pages(struct address_space *mapping, pgoff_t start,
{
unsigned int i;
unsigned int ret;
unsigned int nr_found;
unsigned int nr_found, nr_skip;

rcu_read_lock();
restart:
nr_found = radix_tree_gang_lookup_slot(&mapping->page_tree,
(void ***)pages, NULL, start, nr_pages);
ret = 0;
nr_skip = 0;
for (i = 0; i < nr_found; i++) {
struct page *page;
repeat:
Expand All @@ -856,6 +857,7 @@ unsigned find_get_pages(struct address_space *mapping, pgoff_t start,
* here as an exceptional entry: so skip over it -
* we only reach this from invalidate_mapping_pages().
*/
nr_skip++;
continue;
}

Expand All @@ -876,7 +878,7 @@ unsigned find_get_pages(struct address_space *mapping, pgoff_t start,
* If all entries were removed before we could secure them,
* try again, because callers stop trying once 0 is returned.
*/
if (unlikely(!ret && nr_found))
if (unlikely(!ret && nr_found > nr_skip))
goto restart;
rcu_read_unlock();
return ret;
Expand Down

0 comments on commit f26b6d5

Please sign in to comment.