Index: linux-2.6.14-rc5-mm1/mm/vmscan.c =================================================================== --- linux-2.6.14-rc5-mm1.orig/mm/vmscan.c 2005-10-26 13:52:25.000000000 -0700 +++ linux-2.6.14-rc5-mm1/mm/vmscan.c 2005-10-26 15:03:55.000000000 -0700 @@ -782,6 +782,22 @@ static int migrate_page(struct page *pag return 0; } +int fs_migrate_page(struct page *page, struct page *newpage) +{ + if (PageWriteback(page)) + return 1; + + if (PageDirty(page)) { + /* initiate write */ + return 1; + } + + rc = migrate_page(page, newpage); + if (rc == 0) + move_buffer(page, newpage); +} + + /* * migrate_pages * @@ -817,6 +833,8 @@ redo: failed = 0; list_for_each_entry_safe(page, page2, l, lru) { + struct address_space *mapping = page_mapping(page); + cond_resched(); /* @@ -853,6 +871,25 @@ failed: } #endif /* CONFIG_SWAP */ + if (t && PageDirty(page) && PagePrivate(page && !PageSwapCache(page) && + mapping->a_ops->migrate_page)) { + struct *newpage; + + if (list_empty(t)) + goto failed; + newpage = lru_to_page(t); + + switch (mapping->a_ops->migrate(page, newpage)) { + case 1: + goto retry_later; + case -1: + goto failed; + default: + break; + } + continue; + } + /* * Page is properly locked and writeback is complete. * Try to migrate the page. @@ -871,8 +908,6 @@ failed: goto retry_later; } else { - struct address_space *mapping = page_mapping(page); - if (PageDirty(page) && PagePrivate(page) && !PageWriteback(page) && Index: linux-2.6.14-rc5-mm1/include/linux/fs.h =================================================================== --- linux-2.6.14-rc5-mm1.orig/include/linux/fs.h 2005-10-24 10:27:34.000000000 -0700 +++ linux-2.6.14-rc5-mm1/include/linux/fs.h 2005-10-26 14:37:31.000000000 -0700 @@ -327,6 +327,7 @@ struct address_space_operations { loff_t offset, unsigned long nr_segs); struct page* (*get_xip_page)(struct address_space *, sector_t, int); + int (*migrate_page) (struct page *, struct page *); }; struct backing_dev_info;