Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 21047
b: refs/heads/master
c: 4983da0
h: refs/heads/master
i:
  21045: 9a5f6b5
  21043: 0f23fef
  21039: 398208a
v: v3
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Mar 15, 2006
1 parent 223be5a commit b4bb489
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 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: e843e280cbe218fc8387339806d344708dee348a
refs/heads/master: 4983da07f1e2e8dc81cb9d640fbf35b899cdbdf2
6 changes: 4 additions & 2 deletions trunk/fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -3060,6 +3060,7 @@ int buffer_migrate_page(struct page *newpage, struct page *page)
{
struct address_space *mapping = page->mapping;
struct buffer_head *bh, *head;
int rc;

if (!mapping)
return -EAGAIN;
Expand All @@ -3069,8 +3070,9 @@ int buffer_migrate_page(struct page *newpage, struct page *page)

head = page_buffers(page);

if (migrate_page_remove_references(newpage, page, 3))
return -EAGAIN;
rc = migrate_page_remove_references(newpage, page, 3);
if (rc)
return rc;

bh = head;
do {
Expand Down
18 changes: 12 additions & 6 deletions trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ int migrate_page_remove_references(struct page *newpage,
* the page.
*/
if (!mapping || page_mapcount(page) + nr_refs != page_count(page))
return 1;
return -EAGAIN;

/*
* Establish swap ptes for anonymous pages or destroy pte
Expand All @@ -721,13 +721,15 @@ int migrate_page_remove_references(struct page *newpage,
* If the page was not migrated then the PageSwapCache bit
* is still set and the operation may continue.
*/
try_to_unmap(page, 1);
if (try_to_unmap(page, 1) == SWAP_FAIL)
/* A vma has VM_LOCKED set -> Permanent failure */
return -EPERM;

/*
* Give up if we were unable to remove all mappings.
*/
if (page_mapcount(page))
return 1;
return -EAGAIN;

write_lock_irq(&mapping->tree_lock);

Expand All @@ -738,7 +740,7 @@ int migrate_page_remove_references(struct page *newpage,
if (!page_mapping(page) || page_count(page) != nr_refs ||
*radix_pointer != page) {
write_unlock_irq(&mapping->tree_lock);
return 1;
return -EAGAIN;
}

/*
Expand Down Expand Up @@ -813,10 +815,14 @@ EXPORT_SYMBOL(migrate_page_copy);
*/
int migrate_page(struct page *newpage, struct page *page)
{
int rc;

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

if (migrate_page_remove_references(newpage, page, 2))
return -EAGAIN;
rc = migrate_page_remove_references(newpage, page, 2);

if (rc)
return rc;

migrate_page_copy(newpage, page);

Expand Down

0 comments on commit b4bb489

Please sign in to comment.