Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 28924
b: refs/heads/master
c: 5b5c712
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Jun 23, 2006
1 parent eef27d0 commit 02a5f21
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 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: e7340f73307abed9283d0a07570d06e228c205dd
refs/heads/master: 5b5c7120e2154239837fad5e3c7b7b781092b19c
21 changes: 11 additions & 10 deletions trunk/mm/migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,19 +168,19 @@ static int swap_page(struct page *page)
/*
* Remove references for a page and establish the new page with the correct
* basic settings to be able to stop accesses to the page.
*
* The number of remaining references must be:
* 1 for anonymous pages without a mapping
* 2 for pages with a mapping
* 3 for pages with a mapping and PagePrivate set.
*/
static int migrate_page_remove_references(struct page *newpage,
struct page *page, int nr_refs)
struct page *page)
{
struct address_space *mapping = page_mapping(page);
struct page **radix_pointer;

/*
* Avoid doing any of the following work if the page count
* indicates that the page is in use or truncate has removed
* the page.
*/
if (!mapping || page_mapcount(page) + nr_refs != page_count(page))
if (!mapping)
return -EAGAIN;

/*
Expand Down Expand Up @@ -218,7 +218,8 @@ static int migrate_page_remove_references(struct page *newpage,
&mapping->page_tree,
page_index(page));

if (!page_mapping(page) || page_count(page) != nr_refs ||
if (!page_mapping(page) ||
page_count(page) != 2 + !!PagePrivate(page) ||
*radix_pointer != page) {
write_unlock_irq(&mapping->tree_lock);
return -EAGAIN;
Expand Down Expand Up @@ -309,7 +310,7 @@ int migrate_page(struct page *newpage, struct page *page)

BUG_ON(PageWriteback(page)); /* Writeback must be complete */

rc = migrate_page_remove_references(newpage, page, 2);
rc = migrate_page_remove_references(newpage, page);

if (rc)
return rc;
Expand Down Expand Up @@ -348,7 +349,7 @@ int buffer_migrate_page(struct page *newpage, struct page *page)

head = page_buffers(page);

rc = migrate_page_remove_references(newpage, page, 3);
rc = migrate_page_remove_references(newpage, page);

if (rc)
return rc;
Expand Down

0 comments on commit 02a5f21

Please sign in to comment.