X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=mm%2Fmigrate.c;h=1c25040693d2565b8f1a5affc6eb5bb2310cf15e;hb=d59bf96cdde5b874a57bfd1425faa45da915d0b7;hp=09f6e4aa87fc493f1c4c7accf27ab0280d2b7c01;hpb=be9bf30c73184e0f1e4e0a50fb193d2a551bf75e;p=powerpc.git diff --git a/mm/migrate.c b/mm/migrate.c index 09f6e4aa87..1c25040693 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -16,8 +16,7 @@ #include #include #include -#include /* for try_to_release_page(), - buffer_heads_over_limit */ +#include #include #include #include @@ -28,8 +27,6 @@ #include "internal.h" -#include "internal.h" - /* The maximum number of pages to take off the LRU for migration */ #define MIGRATE_CHUNK_SIZE 256 @@ -176,7 +173,6 @@ unlock_retry: retry: return -EAGAIN; } -EXPORT_SYMBOL(swap_page); /* * Remove references for a page and establish the new page with the correct @@ -234,7 +230,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; } /* @@ -443,6 +439,17 @@ redo: goto unlock_both; } + /* Make sure the dirty bit is up to date */ + if (try_to_unmap(page, 1) == SWAP_FAIL) { + rc = -EPERM; + goto unlock_both; + } + + if (page_mapcount(page)) { + rc = -EAGAIN; + goto unlock_both; + } + /* * Default handling if a filesystem does not provide * a migration function. We can only migrate clean