|
@@ -32,8 +32,6 @@ file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping)
|
|
}
|
|
}
|
|
EXPORT_SYMBOL_GPL(file_ra_state_init);
|
|
EXPORT_SYMBOL_GPL(file_ra_state_init);
|
|
|
|
|
|
-#define list_to_page(head) (list_entry((head)->prev, struct page, lru))
|
|
|
|
-
|
|
|
|
/*
|
|
/*
|
|
* see if a page needs releasing upon read_cache_pages() failure
|
|
* see if a page needs releasing upon read_cache_pages() failure
|
|
* - the caller of read_cache_pages() may have set PG_private or PG_fscache
|
|
* - the caller of read_cache_pages() may have set PG_private or PG_fscache
|
|
@@ -64,7 +62,7 @@ static void read_cache_pages_invalidate_pages(struct address_space *mapping,
|
|
struct page *victim;
|
|
struct page *victim;
|
|
|
|
|
|
while (!list_empty(pages)) {
|
|
while (!list_empty(pages)) {
|
|
- victim = list_to_page(pages);
|
|
|
|
|
|
+ victim = lru_to_page(pages);
|
|
list_del(&victim->lru);
|
|
list_del(&victim->lru);
|
|
read_cache_pages_invalidate_page(mapping, victim);
|
|
read_cache_pages_invalidate_page(mapping, victim);
|
|
}
|
|
}
|
|
@@ -87,7 +85,7 @@ int read_cache_pages(struct address_space *mapping, struct list_head *pages,
|
|
int ret = 0;
|
|
int ret = 0;
|
|
|
|
|
|
while (!list_empty(pages)) {
|
|
while (!list_empty(pages)) {
|
|
- page = list_to_page(pages);
|
|
|
|
|
|
+ page = lru_to_page(pages);
|
|
list_del(&page->lru);
|
|
list_del(&page->lru);
|
|
if (add_to_page_cache_lru(page, mapping, page->index,
|
|
if (add_to_page_cache_lru(page, mapping, page->index,
|
|
mapping_gfp_constraint(mapping, GFP_KERNEL))) {
|
|
mapping_gfp_constraint(mapping, GFP_KERNEL))) {
|
|
@@ -125,7 +123,7 @@ static int read_pages(struct address_space *mapping, struct file *filp,
|
|
}
|
|
}
|
|
|
|
|
|
for (page_idx = 0; page_idx < nr_pages; page_idx++) {
|
|
for (page_idx = 0; page_idx < nr_pages; page_idx++) {
|
|
- struct page *page = list_to_page(pages);
|
|
|
|
|
|
+ struct page *page = lru_to_page(pages);
|
|
list_del(&page->lru);
|
|
list_del(&page->lru);
|
|
if (!add_to_page_cache_lru(page, mapping, page->index,
|
|
if (!add_to_page_cache_lru(page, mapping, page->index,
|
|
mapping_gfp_constraint(mapping, GFP_KERNEL))) {
|
|
mapping_gfp_constraint(mapping, GFP_KERNEL))) {
|