Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 356593
b: refs/heads/master
c: 860f275
h: refs/heads/master
i:
  356591: 6808835
v: v3
  • Loading branch information
Johannes Weiner authored and Linus Torvalds committed Feb 24, 2013
1 parent a73af5c commit 62f0c29
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 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: ef4d43a8075891137ebc064e473d2e904971e933
refs/heads/master: 860f2759d94bf9db637d85d75d074de88af54688
25 changes: 12 additions & 13 deletions trunk/mm/shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,19 +335,19 @@ static unsigned shmem_find_get_pages_and_swap(struct address_space *mapping,
pgoff_t start, unsigned int nr_pages,
struct page **pages, pgoff_t *indices)
{
unsigned int i;
unsigned int ret;
unsigned int nr_found;
void **slot;
unsigned int ret = 0;
struct radix_tree_iter iter;

if (!nr_pages)
return 0;

rcu_read_lock();
restart:
nr_found = radix_tree_gang_lookup_slot(&mapping->page_tree,
(void ***)pages, indices, start, nr_pages);
ret = 0;
for (i = 0; i < nr_found; i++) {
radix_tree_for_each_slot(slot, &mapping->page_tree, &iter, start) {
struct page *page;
repeat:
page = radix_tree_deref_slot((void **)pages[i]);
page = radix_tree_deref_slot(slot);
if (unlikely(!page))
continue;
if (radix_tree_exception(page)) {
Expand All @@ -364,17 +364,16 @@ static unsigned shmem_find_get_pages_and_swap(struct address_space *mapping,
goto repeat;

/* Has the page moved? */
if (unlikely(page != *((void **)pages[i]))) {
if (unlikely(page != *slot)) {
page_cache_release(page);
goto repeat;
}
export:
indices[ret] = indices[i];
indices[ret] = iter.index;
pages[ret] = page;
ret++;
if (++ret == nr_pages)
break;
}
if (unlikely(!ret && nr_found))
goto restart;
rcu_read_unlock();
return ret;
}
Expand Down

0 comments on commit 62f0c29

Please sign in to comment.