projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ide: make ide_hwif_t.ide_dma_host_on void (v2)
[powerpc.git]
/
mm
/
migrate.c
diff --git
a/mm/migrate.c
b/mm/migrate.c
index
20a8c26
..
e9b161b
100644
(file)
--- a/
mm/migrate.c
+++ b/
mm/migrate.c
@@
-294,7
+294,7
@@
out:
static int migrate_page_move_mapping(struct address_space *mapping,
struct page *newpage, struct page *page)
{
static int migrate_page_move_mapping(struct address_space *mapping,
struct page *newpage, struct page *page)
{
-
struct page **radix_pointer
;
+
void **pslot
;
if (!mapping) {
/* Anonymous page */
if (!mapping) {
/* Anonymous page */
@@
-305,12
+305,11
@@
static int migrate_page_move_mapping(struct address_space *mapping,
write_lock_irq(&mapping->tree_lock);
write_lock_irq(&mapping->tree_lock);
- radix_pointer = (struct page **)radix_tree_lookup_slot(
- &mapping->page_tree,
- page_index(page));
+ pslot = radix_tree_lookup_slot(&mapping->page_tree,
+ page_index(page));
if (page_count(page) != 2 + !!PagePrivate(page) ||
if (page_count(page) != 2 + !!PagePrivate(page) ||
-
*radix_pointer
!= page) {
+
(struct page *)radix_tree_deref_slot(pslot)
!= page) {
write_unlock_irq(&mapping->tree_lock);
return -EAGAIN;
}
write_unlock_irq(&mapping->tree_lock);
return -EAGAIN;
}
@@
-318,7
+317,7
@@
static int migrate_page_move_mapping(struct address_space *mapping,
/*
* Now we know that no one else is looking at the page.
*/
/*
* Now we know that no one else is looking at the page.
*/
- get_page(newpage);
+ get_page(newpage);
/* add cache reference */
#ifdef CONFIG_SWAP
if (PageSwapCache(page)) {
SetPageSwapCache(newpage);
#ifdef CONFIG_SWAP
if (PageSwapCache(page)) {
SetPageSwapCache(newpage);
@@
-326,8
+325,14
@@
static int migrate_page_move_mapping(struct address_space *mapping,
}
#endif
}
#endif
- *radix_pointer = newpage;
+ radix_tree_replace_slot(pslot, newpage);
+
+ /*
+ * Drop cache reference from old page.
+ * We know this isn't the last reference.
+ */
__put_page(page);
__put_page(page);
+
write_unlock_irq(&mapping->tree_lock);
return 0;
write_unlock_irq(&mapping->tree_lock);
return 0;
@@
-409,6
+414,7
@@
int migrate_page(struct address_space *mapping,
}
EXPORT_SYMBOL(migrate_page);
}
EXPORT_SYMBOL(migrate_page);
+#ifdef CONFIG_BLOCK
/*
* Migration function for pages with buffers. This function can only be used
* if the underlying filesystem guarantees that no other references to "page"
/*
* Migration function for pages with buffers. This function can only be used
* if the underlying filesystem guarantees that no other references to "page"
@@
-466,6
+472,7
@@
int buffer_migrate_page(struct address_space *mapping,
return 0;
}
EXPORT_SYMBOL(buffer_migrate_page);
return 0;
}
EXPORT_SYMBOL(buffer_migrate_page);
+#endif
/*
* Writeback a page to clean the dirty state
/*
* Writeback a page to clean the dirty state
@@
-525,7
+532,7
@@
static int fallback_migrate_page(struct address_space *mapping,
* Buffers may be managed in a filesystem specific way.
* We must have no buffers or drop them.
*/
* Buffers may be managed in a filesystem specific way.
* We must have no buffers or drop them.
*/
- if (
page_has_buffers
(page) &&
+ if (
PagePrivate
(page) &&
!try_to_release_page(page, GFP_KERNEL))
return -EAGAIN;
!try_to_release_page(page, GFP_KERNEL))
return -EAGAIN;
@@
-950,7
+957,8
@@
asmlinkage long sys_move_pages(pid_t pid, unsigned long nr_pages,
goto out;
pm[i].node = node;
goto out;
pm[i].node = node;
- }
+ } else
+ pm[i].node = 0; /* anything to not match MAX_NUMNODES */
}
/* End marker */
pm[nr_pages].node = MAX_NUMNODES;
}
/* End marker */
pm[nr_pages].node = MAX_NUMNODES;