[PATCH 2.6.18-rc6-mm2] fix migrate_page_move_mapping for radix tree cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alternative to my "revert migrate_move_mapping ..." patch:


Change to radix_tree_{deref|replace}_slot() API requires
change to migrate_page_move_mapping() [only user of those
APIs, so far] to eliminate compiler warnings.

Apply only after backing out the patch:

page-migration-replace-radix_tree_lookup_slot-with-radix_tree_lockup.patch


Signed-off-by:  Lee Schermerhorn <[email protected]>

 mm/migrate.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

Index: linux-2.6.18-rc6-mm2/mm/migrate.c
===================================================================
--- linux-2.6.18-rc6-mm2.orig/mm/migrate.c	2006-09-13 22:32:44.000000000 -0400
+++ linux-2.6.18-rc6-mm2/mm/migrate.c	2006-09-13 22:38:43.000000000 -0400
@@ -294,7 +294,7 @@ out:
 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 */
@@ -305,12 +305,11 @@ static int migrate_page_move_mapping(str
 
 	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) ||
-			radix_tree_deref_slot(radix_pointer) != page) {
+			(struct page *)radix_tree_deref_slot(pslot) != page) {
 		write_unlock_irq(&mapping->tree_lock);
 		return -EAGAIN;
 	}
@@ -326,7 +325,7 @@ static int migrate_page_move_mapping(str
 	}
 #endif
 
-	radix_tree_replace_slot(radix_pointer, newpage);
+	radix_tree_replace_slot(pslot, newpage);
 	__put_page(page);
 	write_unlock_irq(&mapping->tree_lock);
 


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux