The address_space.readapges() function currently takes a list of pages, strung together via page->list. Switch it to using page->lru. This changes the API into filesystems. --- 25-akpm/fs/cifs/file.c | 16 +++++++++------- 25-akpm/fs/mpage.c | 4 ++-- 25-akpm/mm/readahead.c | 10 +++++----- fs/nfs/pagelist.c | 0 fs/nfs/read.c | 0 5 files changed, 16 insertions(+), 14 deletions(-) diff -puN mm/readahead.c~readahead-stop-using-page-list mm/readahead.c --- 25/mm/readahead.c~readahead-stop-using-page-list 2004-04-03 03:00:15.014948936 -0800 +++ 25-akpm/mm/readahead.c 2004-04-03 03:00:15.023947568 -0800 @@ -48,7 +48,7 @@ static inline unsigned long get_min_read return (VM_MIN_READAHEAD * 1024) / PAGE_CACHE_SIZE; } -#define list_to_page(head) (list_entry((head)->prev, struct page, list)) +#define list_to_page(head) (list_entry((head)->prev, struct page, lru)) /** * read_cache_pages - populate an address space with some pages, and @@ -72,7 +72,7 @@ int read_cache_pages(struct address_spac while (!list_empty(pages)) { page = list_to_page(pages); - list_del(&page->list); + list_del(&page->lru); if (add_to_page_cache(page, mapping, page->index, GFP_KERNEL)) { page_cache_release(page); continue; @@ -85,7 +85,7 @@ int read_cache_pages(struct address_spac struct page *victim; victim = list_to_page(pages); - list_del(&victim->list); + list_del(&victim->lru); page_cache_release(victim); } break; @@ -112,7 +112,7 @@ static int read_pages(struct address_spa pagevec_init(&lru_pvec, 0); for (page_idx = 0; page_idx < nr_pages; page_idx++) { struct page *page = list_to_page(pages); - list_del(&page->list); + list_del(&page->lru); if (!add_to_page_cache(page, mapping, page->index, GFP_KERNEL)) { mapping->a_ops->readpage(filp, page); @@ -247,7 +247,7 @@ __do_page_cache_readahead(struct address if (!page) break; page->index = page_offset; - list_add(&page->list, &page_pool); + list_add(&page->lru, &page_pool); ret++; } spin_unlock_irq(&mapping->tree_lock); diff -puN fs/nfs/read.c~readahead-stop-using-page-list fs/nfs/read.c diff -puN fs/nfs/pagelist.c~readahead-stop-using-page-list fs/nfs/pagelist.c diff -puN fs/mpage.c~readahead-stop-using-page-list fs/mpage.c --- 25/fs/mpage.c~readahead-stop-using-page-list 2004-04-03 03:00:15.018948328 -0800 +++ 25-akpm/fs/mpage.c 2004-04-03 03:00:15.024947416 -0800 @@ -329,10 +329,10 @@ mpage_readpages(struct address_space *ma pagevec_init(&lru_pvec, 0); for (page_idx = 0; page_idx < nr_pages; page_idx++) { - struct page *page = list_entry(pages->prev, struct page, list); + struct page *page = list_entry(pages->prev, struct page, lru); prefetchw(&page->flags); - list_del(&page->list); + list_del(&page->lru); if (!add_to_page_cache(page, mapping, page->index, GFP_KERNEL)) { bio = do_mpage_readpage(bio, page, diff -puN fs/cifs/file.c~readahead-stop-using-page-list fs/cifs/file.c --- 25/fs/cifs/file.c~readahead-stop-using-page-list 2004-04-03 03:00:15.020948024 -0800 +++ 25-akpm/fs/cifs/file.c 2004-04-03 03:00:15.212918840 -0800 @@ -898,9 +898,9 @@ static void cifs_copy_cache_pages(struct if(list_empty(pages)) break; - page = list_entry(pages->prev, struct page, list); + page = list_entry(pages->prev, struct page, lru); - list_del(&page->list); + list_del(&page->lru); if (add_to_page_cache(page, mapping, page->index, GFP_KERNEL)) { page_cache_release(page); @@ -962,7 +962,7 @@ cifs_readpages(struct file *file, struct for(i = 0;iprev, struct page, list); + page = list_entry(page_list->prev, struct page, lru); offset = (loff_t)page->index << PAGE_CACHE_SHIFT; /* for reads over a certain size could initiate async read ahead */ @@ -984,8 +984,9 @@ cifs_readpages(struct file *file, struct /* clean up remaing pages off list */ while (!list_empty(page_list) && (i < num_pages)) { - page = list_entry(page_list->prev, struct page, list); - list_del(&page->list); + page = list_entry(page_list->prev, + struct page, lru); + list_del(&page->lru); } break; } else if (bytes_read > 0) { @@ -1002,8 +1003,9 @@ cifs_readpages(struct file *file, struct cFYI(1,("No bytes read cleaning remaining pages off readahead list")); /* BB turn off caching and do new lookup on file size at server? */ while (!list_empty(page_list) && (i < num_pages)) { - page = list_entry(page_list->prev, struct page, list); - list_del(&page->list); + page = list_entry(page_list->prev, + struct page, lru); + list_del(&page->lru); } break; _